diff options
author | Willem Jan Palenstijn | 2010-10-11 17:52:44 +0000 |
---|---|---|
committer | Willem Jan Palenstijn | 2010-10-11 17:52:44 +0000 |
commit | 0fd6b7608e29ba56abb4f5084e752a7bfe26a3b2 (patch) | |
tree | 3b355a5c4c4712e29b35dfb019996b7e5c83b26b /engines/agi/predictive.cpp | |
parent | cc0afa92b32661c7c71049aa33a7764b0f9ffa4b (diff) | |
download | scummvm-rg350-0fd6b7608e29ba56abb4f5084e752a7bfe26a3b2.tar.gz scummvm-rg350-0fd6b7608e29ba56abb4f5084e752a7bfe26a3b2.tar.bz2 scummvm-rg350-0fd6b7608e29ba56abb4f5084e752a7bfe26a3b2.zip |
AGI: Fix one more strncpy/strncat issue
svn-id: r53148
Diffstat (limited to 'engines/agi/predictive.cpp')
-rw-r--r-- | engines/agi/predictive.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index fe92bcd963..414477a381 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -210,13 +210,12 @@ bool AgiEngine::predictiveDialog() { } } - temp[MAXWORDLEN] = 0; - - strncpy(temp, prefix.c_str(), MAXWORDLEN); - strncat(temp, _currentWord.c_str(), MAXWORDLEN); + Common::strlcpy(temp, prefix.c_str(), sizeof(temp)); + Common::strlcat(temp, _currentWord.c_str(), sizeof(temp)); for (int i = prefix.size() + _currentCode.size(); i < MAXWORDLEN; i++) temp[i] = ' '; + temp[MAXWORDLEN] = 0; printText(temp, 0, 8, 7, MAXWORDLEN, 15, 0); _gfx->flushBlock(62, 54, 249, 66); |