From ad5ef64b86d72f120e60b954afb0ebeb04d34a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Einar=20Johan=20Tr=C3=B8an=20S=C3=B8ma=CC=8Aen?= Date: Wed, 17 Apr 2013 16:13:18 +0200 Subject: [PATCH] WINTERMUTE: Replace strcat with strlcat in BaseGame::displayDebugInfo --- engines/wintermute/base/base_game.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index dcf7568447b..4f9df0e8e9f 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();