diff --git a/src/console.cpp b/src/console.cpp index 511019281a..ef62a8f286 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -473,7 +473,7 @@ void IConsoleCmdExec(const char *cmdstr) } } - for (uint i = 0; tokens[i] != NULL; i++) { + for (uint i = 0; i < lengthof(tokens) && tokens[i] != NULL; i++) { DEBUG(console, 8, "Token %d is: '%s'", i, tokens[i]); }