aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2009-05-10 21:27:57 +0000
committerJohannes Schickel2009-05-10 21:27:57 +0000
commit7604301c30553828cae69ea69acf8fde057ac5c2 (patch)
tree63774d02a74faaa7f8982b25846a6c37d704ad2e
parent2a485abd6d03f94813f6e88904af07f709c10772 (diff)
downloadscummvm-rg350-7604301c30553828cae69ea69acf8fde057ac5c2.tar.gz
scummvm-rg350-7604301c30553828cae69ea69acf8fde057ac5c2.tar.bz2
scummvm-rg350-7604301c30553828cae69ea69acf8fde057ac5c2.zip
Support target names of any length.
svn-id: r40438
-rw-r--r--engines/agi/saveload.cpp9
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) {