mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-08 01:10:28 +00:00
(svn r21688) -Codechange: verify the colour code passed to IConsolePrint()/IConsolePrintF() is valid
This commit is contained in:
parent
fee10eeb18
commit
ed186da1be
@ -86,6 +86,8 @@ void IConsoleFree()
|
|||||||
*/
|
*/
|
||||||
void IConsolePrint(ConsoleColour colour_code, const char *string)
|
void IConsolePrint(ConsoleColour colour_code, const char *string)
|
||||||
{
|
{
|
||||||
|
assert(IsValidConsoleColour(colour_code));
|
||||||
|
|
||||||
char *str;
|
char *str;
|
||||||
#ifdef ENABLE_NETWORK
|
#ifdef ENABLE_NETWORK
|
||||||
if (_redirect_console_to_client != INVALID_CLIENT_ID) {
|
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, ...)
|
void CDECL IConsolePrintF(ConsoleColour colour_code, const char *format, ...)
|
||||||
{
|
{
|
||||||
|
assert(IsValidConsoleColour(colour_code));
|
||||||
|
|
||||||
va_list va;
|
va_list va;
|
||||||
char buf[ICON_MAX_STREAMSIZE];
|
char buf[ICON_MAX_STREAMSIZE];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user