[Scummvm-cvs-logs] CVS: scummvm/simon sound.cpp,1.6,1.7 res.cpp,1.11,1.12

Oliver Kiehl olki at users.sourceforge.net
Tue Dec 10 01:51:03 CET 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv5013

Modified Files:
	sound.cpp res.cpp 
Log Message:
fixed compile error in VC++


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/sound.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- sound.cpp	8 Dec 2002 23:06:11 -0000	1.6
+++ sound.cpp	10 Dec 2002 09:50:22 -0000	1.7
@@ -94,10 +94,12 @@
 	file->open(filename, gameDataPath);
 
 	if (file->isOpen() == false) {
-		char filename2[strlen(filename) + 1];
+		char *filename2;
+		filename2 = (char *)malloc(strlen(filename) + 1);
 		strcpy(filename2, filename);
 		strcat(filename2, ".");
 		file->open(filename2, gameDataPath);
+		free(filename2);
 		if (file->isOpen() == false) {
 			if (atoi(filename + 6) != 1 && atoi(filename + 6) != 30)
 			warning("readSfxFile: Cannot load sfx file %s", filename);

Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- res.cpp	8 Dec 2002 23:06:11 -0000	1.11
+++ res.cpp	10 Dec 2002 09:50:22 -0000	1.12
@@ -103,10 +103,12 @@
 	/* read main gamepc file */
 	in->open(filename, _gameDataPath);
 	if (in->isOpen() == false) {
-		char filename2[strlen(filename) + 1];
+		char *filename2;
+		filename2 = (char *)malloc(strlen(filename) + 1);
 		strcpy(filename2, filename);
 		strcat(filename2, ".");
 		in->open(filename2, _gameDataPath);
+		free(filename2);
 		if (in->isOpen() == false)
 			return false;
 	}





More information about the Scummvm-git-logs mailing list