diff options
Diffstat (limited to 'simon/sound.cpp')
-rw-r--r-- | simon/sound.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |