diff options
-rw-r--r-- | engines/agi/saveload.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index cad8bdf29c..a27da3053f 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -508,9 +508,12 @@ int AgiEngine::loadGame(const char *fileName, bool checkId) { #define NUM_VISIBLE_SLOTS 12 const char *AgiEngine::getSavegameFilename(int num) { - static char saveLoadSlot[100]; - sprintf(saveLoadSlot, "%s.%.3d", _targetName.c_str(), num); - return saveLoadSlot; + static Common::String saveLoadSlot; + char extension[5]; + snprintf(extension, sizeof(extension), ".%3d", num); + + saveLoadSlot = _targetName + extension; + return saveLoadSlot.c_str(); } void AgiEngine::getSavegameDescription(int num, char *buf, bool showEmpty) { |