AGI: Better pointer checking

This commit is contained in:
Eugene Sandulenko 2015-11-27 22:49:18 +01:00
parent 9855957697
commit 8f3d528b7e

View File

@ -161,11 +161,13 @@ void AgiEngine::dictionaryWords(char *msg) {
char *q = NULL;
int wid, wlen;
assert(msg);
debugC(2, kDebugLevelScripts, "msg = \"%s\"", msg);
cleanInput();
for (p = msg; p && *p && getvar(vWordNotFound) == 0;) {
for (p = msg; *p && getvar(vWordNotFound) == 0;) {
if (*p == 0x20)
p++;
@ -205,7 +207,7 @@ void AgiEngine::dictionaryWords(char *msg) {
break;
}
if (p != NULL && *p) {
if (*p) {
debugC(2, kDebugLevelScripts, "p = %s", p);
*p = 0;
p++;