From 09349c2bcac228fe92ab05b4c4004881347697a3 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 26 Nov 2011 22:37:44 +0200 Subject: TOLTECS: Don't call c_str() on the return value of Common::String::format() --- engines/toltecs/menu.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp index 5ff0019d31..00a0372e99 100644 --- a/engines/toltecs/menu.cpp +++ b/engines/toltecs/menu.cpp @@ -253,8 +253,8 @@ void MenuSystem::initMenu(MenuID menuID) { addClickTextItem(kItemIdSavegameDown, 0, 195, 545, 1, "\\", 255, 253); addClickTextItem(kItemIdCancel, 0, 275, 320, 0, _vm->getSysString(kStrCancel), 255, 253); for (int i = 1; i <= 7; i++) { - const char *saveDesc = Common::String::format("SAVEGAME %d", i).c_str(); - addClickTextItem((ItemID)(kItemIdSavegame1 + i - 1), 0, 115 + 20 * (i - 1), 300, 0, saveDesc, 231, 234); + Common::String saveDesc = Common::String::format("SAVEGAME %d", i); + addClickTextItem((ItemID)(kItemIdSavegame1 + i - 1), 0, 115 + 20 * (i - 1), 300, 0, saveDesc.c_str(), 231, 234); } loadSavegamesList(); setSavegameCaptions(); @@ -265,8 +265,8 @@ void MenuSystem::initMenu(MenuID menuID) { addClickTextItem(kItemIdSavegameDown, 0, 195, 545, 1, "\\", 255, 253); addClickTextItem(kItemIdCancel, 0, 275, 320, 0, _vm->getSysString(kStrCancel), 255, 253); for (int i = 1; i <= 7; i++) { - const char *saveDesc = Common::String::format("SAVEGAME %d", i).c_str(); - addClickTextItem((ItemID)(kItemIdSavegame1 + i - 1), 0, 115 + 20 * (i - 1), 300, 0, saveDesc, 231, 234); + Common::String saveDesc = Common::String::format("SAVEGAME %d", i); + addClickTextItem((ItemID)(kItemIdSavegame1 + i - 1), 0, 115 + 20 * (i - 1), 300, 0, saveDesc.c_str(), 231, 234); } newSlotNum = loadSavegamesList() + 1; _savegames.push_back(SavegameItem(newSlotNum, Common::String::format("GAME %03d", _savegames.size() + 1))); -- cgit v1.2.3