Silenced some more cppcheck warnings.

svn-id: r47785
This commit is contained in:
Torbjörn Andersson 2010-01-31 23:28:12 +00:00
parent b0b7764178
commit c5be030077
2 changed files with 4 additions and 0 deletions

View File

@ -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());

View File

@ -180,6 +180,7 @@ static Common::String generateFilenameForDetection(const char *pattern, Filename
error("generateFilenameForDetection: Unsupported genMethod");
}
buf[sizeof(buf) - 1] = 0;
return buf;
}