[Scummvm-git-logs] scummvm master -> 37e083dcafd4e1243271760974f3671d8a537cf9

dreammaster paulfgilbert at gmail.com
Tue Feb 12 03:27:06 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
37e083dcaf GLK: ALAN2: Fix incorrect string duplication


Commit: 37e083dcafd4e1243271760974f3671d8a537cf9
    https://github.com/scummvm/scummvm/commit/37e083dcafd4e1243271760974f3671d8a537cf9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-02-11T18:26:55-08:00

Commit Message:
GLK: ALAN2: Fix incorrect string duplication

Changed paths:
    engines/glk/alan2/parse.cpp


diff --git a/engines/glk/alan2/parse.cpp b/engines/glk/alan2/parse.cpp
index dd06238..17e4dc9 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] == ',') {





More information about the Scummvm-git-logs mailing list