aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-01-31 23:28:12 +0000
committerTorbjörn Andersson2010-01-31 23:28:12 +0000
commitc5be030077d5a148eb376b5acb78af1499c0a58b (patch)
tree3a850d65281f52cad8efed8ef9e7a710d08034ab /engines/agi
parentb0b7764178bcb9fcf3fb590abd717c056894a66a (diff)
downloadscummvm-rg350-c5be030077d5a148eb376b5acb78af1499c0a58b.tar.gz
scummvm-rg350-c5be030077d5a148eb376b5acb78af1499c0a58b.tar.bz2
scummvm-rg350-c5be030077d5a148eb376b5acb78af1499c0a58b.zip
Silenced some more cppcheck warnings.
svn-id: r47785
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/predictive.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index a3725249e6..c4b6649563 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -73,6 +73,7 @@ void bringWordtoTop(char *str, int wordnum) {
if (!str)
return;
strncpy(buf, str, MAXLINELEN);
+ buf[MAXLINELEN - 1] = 0;
char *word = strtok(buf, " ");
if (!word) {
debug("Invalid dictionary line");
@@ -415,6 +416,7 @@ bool AgiEngine::predictiveDialog() {
_wordNumber = (_wordNumber + 1) % numMatchingWords;
char tmp[MAXLINELEN];
strncpy(tmp, _predictiveDictActLine, MAXLINELEN);
+ tmp[MAXLINELEN - 1] = 0;
char *tok = strtok(tmp, " ");
for (uint8 i = 0; i <= _wordNumber; i++)
tok = strtok(NULL, " ");
@@ -590,6 +592,7 @@ bool AgiEngine::matchWord() {
_predictiveDictActLine = _predictiveDictLine[line];
char tmp[MAXLINELEN];
strncpy(tmp, _predictiveDictActLine, MAXLINELEN);
+ tmp[MAXLINELEN - 1] = 0;
char *tok = strtok(tmp, " ");
tok = strtok(NULL, " ");
_currentWord = String(tok, _currentCode.size());