aboutsummaryrefslogtreecommitdiff
path: root/engines/dialogs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/dialogs.cpp')
-rw-r--r--engines/dialogs.cpp8
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();
}