diff options
author | D G Turner | 2019-09-14 01:22:25 +0100 |
---|---|---|
committer | D G Turner | 2019-09-14 01:22:25 +0100 |
commit | 04d522121bfd3d42426ac8766fa0814286a02d8b (patch) | |
tree | 8aa7ad7724aec80a54cb56a8d7791180be9fc220 | |
parent | 019de0cc23b698bff56601e662fb5c44cf99a98e (diff) | |
download | scummvm-rg350-04d522121bfd3d42426ac8766fa0814286a02d8b.tar.gz scummvm-rg350-04d522121bfd3d42426ac8766fa0814286a02d8b.tar.bz2 scummvm-rg350-04d522121bfd3d42426ac8766fa0814286a02d8b.zip |
HDB: Remove Fixed Sized String Buffers in Menu Code
These are replaced by Common::String usage.
-rw-r--r-- | engines/hdb/menu.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp index 6c89c93828..77d43a7698 100644 --- a/engines/hdb/menu.cpp +++ b/engines/hdb/menu.cpp @@ -841,9 +841,8 @@ void Menu::drawMenu() { g_hdb->_gfx->drawText(_saveGames[i].mapName); g_hdb->_gfx->setCursor(_saveSlotX + 180, i * 32 + _saveSlotY); - char buff[16]; - sprintf(buff, "%02d:%02d", seconds / 3600, (seconds / 60) % 60); - g_hdb->_gfx->drawText(buff); + Common::String buff = Common::String::format("%02d:%02d", seconds / 3600, (seconds / 60) % 60); + g_hdb->_gfx->drawText(buff.c_str()); } } } @@ -1605,11 +1604,11 @@ void Menu::processInput(int x, int y) { g_hdb->_gfx->updateVideo(); _warpActive = 0; - char string[16]; - sprintf(string, "MAP%02d", map); + Common::String mapString = Common::String::format("MAP%02d", map); - if (g_hdb->isDemo()) - strcat(string, "_DEMO"); + if (g_hdb->isDemo()) { + mapString += "_DEMO"; + } freeMenu(); g_hdb->setGameState(GAME_PLAY); @@ -1617,7 +1616,7 @@ void Menu::processInput(int x, int y) { g_hdb->_ai->clearPersistent(); g_hdb->resetTimer(); g_hdb->_sound->playSound(SND_POP); - g_hdb->startMap(string); + g_hdb->startMap(mapString.c_str()); } } else if (_quitActive) { //------------------------------------------------------------------- |