From c6b85c2a876f898deb6c7c6fe1938e33d70cd844 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 17 Sep 2010 12:54:00 +0000 Subject: I18N: Use a String instead of a char buffer. This should improve r52751, since String does automatic memory handling, thus no more buffer overflows should by possible by having a too large translated string. svn-id: r52758 --- engines/agos/saveload.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engines/agos/saveload.cpp b/engines/agos/saveload.cpp index a734c4bfae..ffa95506c5 100644 --- a/engines/agos/saveload.cpp +++ b/engines/agos/saveload.cpp @@ -147,14 +147,14 @@ void AGOSEngine::quickLoadOrSave() { } bool success; - char buf[80]; + Common::String buf; char *filename = genSaveName(_saveLoadSlot); if (_saveLoadType == 2) { Subroutine *sub; success = loadGame(genSaveName(_saveLoadSlot)); if (!success) { - snprintf(buf, sizeof(buf), _("Failed to load game state from file:\n\n%s"), filename); + buf = Common::String::printf(_("Failed to load game state from file:\n\n%s"), filename); } else if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) { drawIconArray(2, me(), 0, 0); setBitFlag(97, true); @@ -189,7 +189,7 @@ void AGOSEngine::quickLoadOrSave() { } else { success = saveGame(_saveLoadSlot, _saveLoadName); if (!success) - snprintf(buf, sizeof(buf), _("Failed to save game state to file:\n\n%s"), filename); + buf = Common::String::printf(_("Failed to save game state to file:\n\n%s"), filename); } if (!success) { @@ -197,7 +197,7 @@ void AGOSEngine::quickLoadOrSave() { dialog.runModal(); } else if (_saveLoadType == 1) { - snprintf(buf, sizeof(buf), _("Successfully saved game state in file:\n\n%s"), filename); + buf = Common::String::printf(_("Successfully saved game state in file:\n\n%s"), filename); GUI::TimedMessageDialog dialog(buf, 1500); dialog.runModal(); -- cgit v1.2.3