diff options
author | Einar Johan Trøan Sømåen | 2013-04-17 16:13:18 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2013-04-17 16:13:18 +0200 |
commit | ad5ef64b86d72f120e60b954afb0ebeb04d34a9a (patch) | |
tree | dea1be8bf4eced6e5cf3e2dde86a9369024ad047 | |
parent | 3185e9157605d77338b0cde3fcb15703ce0381b5 (diff) | |
download | scummvm-rg350-ad5ef64b86d72f120e60b954afb0ebeb04d34a9a.tar.gz scummvm-rg350-ad5ef64b86d72f120e60b954afb0ebeb04d34a9a.tar.bz2 scummvm-rg350-ad5ef64b86d72f120e60b954afb0ebeb04d34a9a.zip |
WINTERMUTE: Replace strcat with strlcat in BaseGame::displayDebugInfo
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index dcf7568447..4f9df0e8e9 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -3858,8 +3858,9 @@ bool BaseGame::onWindowClose() { ////////////////////////////////////////////////////////////////////////// bool BaseGame::displayDebugInfo() { - char str[100]; - + const uint32 strLength = 100; + char str[strLength]; + if (_debugShowFPS) { sprintf(str, "FPS: %d", _gameRef->_fps); _systemFont->drawText((byte *)str, 0, 0, 100, TAL_LEFT); @@ -3872,9 +3873,9 @@ bool BaseGame::displayDebugInfo() { sprintf(str, "Mode: %dx%d windowed", _renderer->_width, _renderer->_height); } - strcat(str, " ("); - strcat(str, _renderer->getName().c_str()); - strcat(str, ")"); + Common::strlcat(str, " (", strLength); + Common::strlcat(str, _renderer->getName().c_str(), strLength); + Common::strlcat(str, ")", strLength); _systemFont->drawText((byte *)str, 0, 0, _renderer->_width, TAL_RIGHT); _renderer->displayDebugInfo(); |