summaryrefslogtreecommitdiff
path: root/src/console.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2011-01-01 17:06:59 +0000
committersmatz <smatz@openttd.org>2011-01-01 17:06:59 +0000
commitcae28bf8eb38e5856420b5374c6aa971d492eacf (patch)
tree6430e5fa3858ef764b2c9a2ad0443f59285e727e /src/console.cpp
parent666fbb28c273ab94ac854b7cdda22c0881a24dba (diff)
downloadopenttd-cae28bf8eb38e5856420b5374c6aa971d492eacf.tar.xz
(svn r21688) -Codechange: verify the colour code passed to IConsolePrint()/IConsolePrintF() is valid
Diffstat (limited to 'src/console.cpp')
-rw-r--r--src/console.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/console.cpp b/src/console.cpp
index 7389c9bb8..c38608f91 100644
--- a/src/console.cpp
+++ b/src/console.cpp
@@ -86,6 +86,8 @@ void IConsoleFree()
*/
void IConsolePrint(ConsoleColour colour_code, const char *string)
{
+ assert(IsValidConsoleColour(colour_code));
+
char *str;
#ifdef ENABLE_NETWORK
if (_redirect_console_to_client != INVALID_CLIENT_ID) {
@@ -128,6 +130,8 @@ void IConsolePrint(ConsoleColour colour_code, const char *string)
*/
void CDECL IConsolePrintF(ConsoleColour colour_code, const char *format, ...)
{
+ assert(IsValidConsoleColour(colour_code));
+
va_list va;
char buf[ICON_MAX_STREAMSIZE];