From 37e083dcafd4e1243271760974f3671d8a537cf9 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Mon, 11 Feb 2019 18:26:55 -0800 Subject: GLK: ALAN2: Fix incorrect string duplication --- engines/glk/alan2/parse.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'engines/glk') 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] == ',') { -- cgit v1.2.3