summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2017-06-22 16:31:04 +0000
committerfrosch <frosch@openttd.org>2017-06-22 16:31:04 +0000
commitbb02505fb3a4ddf403871cd2010c4517dc32c516 (patch)
tree311dd1795c938cdde716a5c049ff0c753e52d982 /src
parent594f1237ceb00c105572227f31e5c773cf6ebbae (diff)
downloadopenttd-bb02505fb3a4ddf403871cd2010c4517dc32c516.tar.xz
(svn r27883) -Fix [FS#6576]: Console command parser passed invalid strings to the debug output, if command lines had many parameters.
Diffstat (limited to 'src')
-rw-r--r--src/console.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/console.cpp b/src/console.cpp
index 511019281..ef62a8f28 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]);
}