From 37886ba7bb53b1df1bf69c3e43c13b01639a6f80 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Thu, 2 Jun 2011 03:03:21 +0100 Subject: CRUISE: Replace snprintf() usage with Common::String::format() Safer and less portability issues. --- engines/cruise/menu.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/cruise/menu.cpp b/engines/cruise/menu.cpp index 407858574c..bb81797216 100644 --- a/engines/cruise/menu.cpp +++ b/engines/cruise/menu.cpp @@ -225,13 +225,10 @@ static void handleSaveLoad(bool saveFlag) { Common::String result(dialog->getResultString()); if (result.empty()) { // If the user was lazy and entered no save name, come up with a default name. - char buf[20]; - snprintf(buf, 20, "Save %d", slot + 1); - - _vm->saveGameState(slot, buf); - } else { - _vm->saveGameState(slot, result.c_str()); + result = Common::String::format("Save %d", slot + 1); } + + _vm->saveGameState(slot, result.c_str()); } } -- cgit v1.2.3