Mercurial > hg > openttd
changeset 16952:f220788812ba draft
(svn r21688) -Codechange: verify the colour code passed to IConsolePrint()/IConsolePrintF() is valid
author | smatz <smatz@openttd.org> |
---|---|
date | Sat, 01 Jan 2011 17:06:59 +0000 |
parents | b363297469db |
children | bdbffbe0e465 |
files | src/console.cpp |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/console.cpp +++ b/src/console.cpp @@ -86,6 +86,8 @@ */ 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 CDECL IConsolePrintF(ConsoleColour colour_code, const char *format, ...) { + assert(IsValidConsoleColour(colour_code)); + va_list va; char buf[ICON_MAX_STREAMSIZE];