diff options
author | D G Turner | 2019-09-14 01:40:26 +0100 |
---|---|---|
committer | D G Turner | 2019-09-14 01:43:09 +0100 |
commit | 0d498a203674a3530ed2516a2b7116d6fe6f69e2 (patch) | |
tree | 6838e815817fa52ba4b127f9b139d1a0ed43f108 /engines/hdb | |
parent | 52da0646558d5ba744fafdef9fe2f480c38f9b13 (diff) | |
download | scummvm-rg350-0d498a203674a3530ed2516a2b7116d6fe6f69e2.tar.gz scummvm-rg350-0d498a203674a3530ed2516a2b7116d6fe6f69e2.tar.bz2 scummvm-rg350-0d498a203674a3530ed2516a2b7116d6fe6f69e2.zip |
HDB: Remove More Fixed Sized String Buffers in Menu Code
Diffstat (limited to 'engines/hdb')
-rw-r--r-- | engines/hdb/menu.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/engines/hdb/menu.cpp b/engines/hdb/menu.cpp index 77d43a7698..a9b1f4a75f 100644 --- a/engines/hdb/menu.cpp +++ b/engines/hdb/menu.cpp @@ -857,27 +857,27 @@ void Menu::drawMenu() { _titleLogo->drawMasked(centerPic(_titleLogo), _rocketY + _mTitleY); _menuBackoutGfx->drawMasked(_warpBackoutX, g_hdb->_menu->_warpBackoutY); - char string[32]; + Common::String textString; for (int i = 0; i < 10; i++) { - sprintf(string, "Map %2d", i); + textString = Common::String::format("Map %2d", i); g_hdb->_gfx->setCursor(_warpX + 4, i * 16 + _warpY); - g_hdb->_gfx->drawText(string); + g_hdb->_gfx->drawText(textString.c_str()); } for (int i = 0; i < 10; i++) { - sprintf(string, "Map %d", i + 10); + textString = Common::String::format("Map %d", i + 10); g_hdb->_gfx->setCursor(_warpX + 80, i * 16 + _warpY); - g_hdb->_gfx->drawText(string); + g_hdb->_gfx->drawText(textString.c_str()); } for (int i = 0; i < 10; i++) { - sprintf(string, "Map %d", i + 20); + textString = Common::String::format("Map %d", i + 20); g_hdb->_gfx->setCursor(_warpX + 160, i * 16 + _warpY); - g_hdb->_gfx->drawText(string); + g_hdb->_gfx->drawText(textString.c_str()); } if (_warpActive > 1) { g_hdb->_gfx->setCursor(_warpX + 60, _warpY + 164); - sprintf(string, "Warping to MAP%d", _warpActive - 2); - g_hdb->_gfx->centerPrint(string); + textString = Common::String::format("Warping to MAP%d", _warpActive - 2); + g_hdb->_gfx->centerPrint(textString.c_str()); } } else if (_quitActive) { //------------------------------------------------------------------- @@ -1310,7 +1310,7 @@ void Menu::fillSavegameSlots() { } else { Graphics::skipThumbnail(*in); - strcpy(_saveGames[i].saveID, saveGameFile.c_str()); + Common::strlcpy(_saveGames[i].saveID, saveGameFile.c_str(), sizeof(_saveGames[0].saveID)); _saveGames[i].seconds = in->readUint32LE(); in->read(_saveGames[i].mapName, 32); delete in; |