diff options
author | smatz <smatz@openttd.org> | 2011-01-01 17:06:59 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2011-01-01 17:06:59 +0000 |
commit | cae28bf8eb38e5856420b5374c6aa971d492eacf (patch) | |
tree | 6430e5fa3858ef764b2c9a2ad0443f59285e727e /src | |
parent | 666fbb28c273ab94ac854b7cdda22c0881a24dba (diff) | |
download | openttd-cae28bf8eb38e5856420b5374c6aa971d492eacf.tar.xz |
(svn r21688) -Codechange: verify the colour code passed to IConsolePrint()/IConsolePrintF() is valid
Diffstat (limited to 'src')
-rw-r--r-- | src/console.cpp | 4 |
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]; |