diff options
author | Johannes Schickel | 2008-11-09 12:16:51 +0000 |
---|---|---|
committer | Johannes Schickel | 2008-11-09 12:16:51 +0000 |
commit | 44853bf2af97f94defb5b242e17429aceea0d3dc (patch) | |
tree | 8eb91d9a995f31c9d979f3d84544e050b9c0211b | |
parent | f2174f57511ae3c50a7e87cf063ae7e8174a583b (diff) | |
download | scummvm-rg350-44853bf2af97f94defb5b242e17429aceea0d3dc.tar.gz scummvm-rg350-44853bf2af97f94defb5b242e17429aceea0d3dc.tar.bz2 scummvm-rg350-44853bf2af97f94defb5b242e17429aceea0d3dc.zip |
Fixed bug, which might mess up the description of new savegames.
svn-id: r34949
-rw-r--r-- | engines/dialogs.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 22480ea082..ce7907f965 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -169,17 +169,15 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat // FIXME: at this point, the save list's selItem is -1! //Common::String result(_saveDialog->getResultString()); Common::String result; - const char *desc; if (result.empty()) { // If the user was lazy and entered no save name, come up with a default name. char buf[20]; - sprintf(buf, "Save %d", slot + 1); - desc = buf; + snprintf(buf, 20, "Save %d", slot + 1); + _engine->saveGameState(slot, buf); } else { - desc = result.c_str(); + _engine->saveGameState(slot, result.c_str()); } - _engine->saveGameState(slot, desc); close(); } |