diff options
author | D G Turner | 2019-09-15 00:28:28 +0100 |
---|---|---|
committer | D G Turner | 2019-09-15 00:28:28 +0100 |
commit | 9467bf7faa89d21b81f415c352272e8de1f52302 (patch) | |
tree | 2b222d064a62f4b1ed4e8ede3d64d3226cf498df /engines | |
parent | 8a65f44311657e2883646d67ec7dffdc4e2813b7 (diff) | |
download | scummvm-rg350-9467bf7faa89d21b81f415c352272e8de1f52302.tar.gz scummvm-rg350-9467bf7faa89d21b81f415c352272e8de1f52302.tar.bz2 scummvm-rg350-9467bf7faa89d21b81f415c352272e8de1f52302.zip |
SWORD1: Remove Fixed Sized Buffer Usage from Savegame Name Code
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword1/control.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp index 0c53430ba3..d385b2e739 100644 --- a/engines/sword1/control.cpp +++ b/engines/sword1/control.cpp @@ -927,15 +927,15 @@ void Control::showSavegameNames() { _buttons[cnt]->draw(); uint8 textMode = TEXT_LEFT_ALIGN; uint16 ycoord = _saveButtons[cnt].y + 2; - uint8 str[40]; - sprintf((char *)str, "%d. %s", cnt + _saveScrollPos + 1, _saveNames[cnt + _saveScrollPos].c_str()); + Common::String savegameNameStr = Common::String::format("%d. %s", cnt + _saveScrollPos + 1, _saveNames[cnt + _saveScrollPos].c_str()); if (cnt + _saveScrollPos == _selectedSavegame) { textMode |= TEXT_RED_FONT; ycoord += 2; - if (_cursorVisible) - strcat((char *)str, "_"); + if (_cursorVisible) { + savegameNameStr += "_"; + } } - renderText(str, _saveButtons[cnt].x + 6, ycoord, textMode); + renderText((const uint8*)savegameNameStr.c_str(), _saveButtons[cnt].x + 6, ycoord, textMode); } } |