aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2010-09-17 12:54:00 +0000
committerJohannes Schickel2010-09-17 12:54:00 +0000
commitc6b85c2a876f898deb6c7c6fe1938e33d70cd844 (patch)
tree644b7fa718c7cf3aa47de0f331daf4d521fce180 /engines
parent88e7bb49957c0ce27536f8f705776abd6dc7f140 (diff)
downloadscummvm-rg350-c6b85c2a876f898deb6c7c6fe1938e33d70cd844.tar.gz
scummvm-rg350-c6b85c2a876f898deb6c7c6fe1938e33d70cd844.tar.bz2
scummvm-rg350-c6b85c2a876f898deb6c7c6fe1938e33d70cd844.zip
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
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/saveload.cpp8
1 files 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();