From 37b9c311184c21dda3da165c18933b707d2a227b Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 3 Jan 2011 12:04:53 +0000 Subject: [PATCH] (svn r21702) -Fix: make sure the colour argument of echoc is properly validated to be a text colour --- src/console_cmds.cpp | 2 +- src/gfx_type.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 85c3a6d983..4012c1c8a8 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -958,7 +958,7 @@ DEF_CONSOLE_CMD(ConEchoC) } if (argc < 3) return false; - IConsolePrint((TextColour)atoi(argv[1]), argv[2]); + IConsolePrint((TextColour)Clamp(atoi(argv[1]), TC_BEGIN, TC_END - 1), argv[2]); return true; } diff --git a/src/gfx_type.h b/src/gfx_type.h index e99e3414d6..79b30fb2b7 100644 --- a/src/gfx_type.h +++ b/src/gfx_type.h @@ -204,6 +204,7 @@ template <> struct EnumPropsT : MakeEnumPropsT