aboutsummaryrefslogtreecommitdiff
path: root/engines/glk
diff options
context:
space:
mode:
authorPaul Gilbert2019-02-11 18:26:55 -0800
committerPaul Gilbert2019-02-11 18:26:55 -0800
commit37e083dcafd4e1243271760974f3671d8a537cf9 (patch)
tree6a089fe7fdec12a9fd3a8d6d3adb5e11e47c3908 /engines/glk
parentc03e52bebbfbd5f18cdc3dfd6732f170162c9c3e (diff)
downloadscummvm-rg350-37e083dcafd4e1243271760974f3671d8a537cf9.tar.gz
scummvm-rg350-37e083dcafd4e1243271760974f3671d8a537cf9.tar.bz2
scummvm-rg350-37e083dcafd4e1243271760974f3671d8a537cf9.zip
GLK: ALAN2: Fix incorrect string duplication
Diffstat (limited to 'engines/glk')
-rw-r--r--engines/glk/alan2/parse.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/engines/glk/alan2/parse.cpp b/engines/glk/alan2/parse.cpp
index dd0623888e..17e4dc9db3 100644
--- a/engines/glk/alan2/parse.cpp
+++ b/engines/glk/alan2/parse.cpp
@@ -164,7 +164,6 @@ void Parser::agetline() {
void Parser::scan() {
uint i;
int w;
- char *str;
agetline();
wrds[0] = 0;
@@ -204,7 +203,7 @@ void Parser::scan() {
Common::String tmp = token;
tmp.deleteChar(0);
tmp.deleteLastChar();
- strcpy(str, tmp.c_str());
+ char *str = scumm_strdup(tmp.c_str());
litValues[litCount++].value = (Aptr) str;
} else if (token[0] == ',') {