aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiehl2002-12-10 09:50:22 +0000
committerOliver Kiehl2002-12-10 09:50:22 +0000
commit6582e62e14877967e2fb6d16d70606f7e1805f96 (patch)
tree1e78a5e980e40df0b08ca3724c73747f1f2c4f2d
parent098b1d52ca7ad394eaee0481c6c43ed0234166f6 (diff)
downloadscummvm-rg350-6582e62e14877967e2fb6d16d70606f7e1805f96.tar.gz
scummvm-rg350-6582e62e14877967e2fb6d16d70606f7e1805f96.tar.bz2
scummvm-rg350-6582e62e14877967e2fb6d16d70606f7e1805f96.zip
fixed compile error in VC++
svn-id: r5897
-rw-r--r--simon/res.cpp4
-rw-r--r--simon/sound.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/simon/res.cpp b/simon/res.cpp
index f179986936..b63a18badb 100644
--- a/simon/res.cpp
+++ b/simon/res.cpp
@@ -103,10 +103,12 @@ bool SimonState::loadGamePcFile(const char *filename)
/* 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;
}
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 3c316396b5..fd036d27ed 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -94,10 +94,12 @@ void SimonSound::readSfxFile(const char *filename, const char *gameDataPath)
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);