aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--simon/res.cpp2
-rw-r--r--simon/sound.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/simon/res.cpp b/simon/res.cpp
index b7fe38f4e6..b8e4b11c03 100644
--- a/simon/res.cpp
+++ b/simon/res.cpp
@@ -103,7 +103,7 @@ void SimonState::loadGamePcFile(const char *filename) {
in->open(filename, _gameDataPath);
if (in->isOpen() == false) {
char *filename2;
- filename2 = (char *)malloc(strlen(filename) + 1);
+ filename2 = (char *)malloc(strlen(filename) + 2);
strcpy(filename2, filename);
strcat(filename2, ".");
in->open(filename2, _gameDataPath);
diff --git a/simon/sound.cpp b/simon/sound.cpp
index 6e7724a44e..c90dddbca4 100644
--- a/simon/sound.cpp
+++ b/simon/sound.cpp
@@ -118,7 +118,7 @@ void SimonSound::readSfxFile(const char *filename, const char *gameDataPath) {
if (file->isOpen() == false) {
char *filename2;
- filename2 = (char *)malloc(strlen(filename) + 1);
+ filename2 = (char *)malloc(strlen(filename) + 2);
strcpy(filename2, filename);
strcat(filename2, ".");
file->open(filename2, gameDataPath);