aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-10-03 21:15:23 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2009-10-03 21:15:23 +0000
commite62ceb3c2672a11f6ea41adb93c1cf9e54ab1ef3 (patch)
treec487d37ef8c14724e35dff74adff6771acfbecf3 /code/qcommon
parent712284e8ad585a4d95fd094aeb71818b64501cc7 (diff)
downloadioquake3-aero-e62ceb3c2672a11f6ea41adb93c1cf9e54ab1ef3.tar.gz
ioquake3-aero-e62ceb3c2672a11f6ea41adb93c1cf9e54ab1ef3.zip
- Modify color generating codes to only accept numbers and not alphabetical chars anymore
- Fix client clean name so that it cannot be tricked anymore, see https://bugzilla.icculus.org/show_bug.cgi?id=3313 git-svn-id: svn://svn.icculus.org/quake3/trunk@1638 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon')
-rw-r--r--code/qcommon/q_shared.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/code/qcommon/q_shared.h b/code/qcommon/q_shared.h
index 19db09c..736d9e9 100644
--- a/code/qcommon/q_shared.h
+++ b/code/qcommon/q_shared.h
@@ -365,20 +365,20 @@ extern vec4_t colorMdGrey;
extern vec4_t colorDkGrey;
#define Q_COLOR_ESCAPE '^'
-#define Q_IsColorString(p) ( p && *(p) == Q_COLOR_ESCAPE && *((p)+1) && isalnum(*((p)+1)) ) // ^[0-9a-zA-Z]
+#define Q_IsColorString(p) ((p) && *(p) == Q_COLOR_ESCAPE && *((p)+1) && *((p)+1) >= '0' && *((p)+1) <= '7') // ^[0-9a-zA-Z]
-#define COLOR_BLACK '0'
-#define COLOR_RED '1'
-#define COLOR_GREEN '2'
+#define COLOR_BLACK '0'
+#define COLOR_RED '1'
+#define COLOR_GREEN '2'
#define COLOR_YELLOW '3'
-#define COLOR_BLUE '4'
-#define COLOR_CYAN '5'
+#define COLOR_BLUE '4'
+#define COLOR_CYAN '5'
#define COLOR_MAGENTA '6'
-#define COLOR_WHITE '7'
-#define ColorIndex(c) ( ( (c) - '0' ) & 7 )
+#define COLOR_WHITE '7'
+#define ColorIndex(c) ((c) - '0')
#define S_COLOR_BLACK "^0"
-#define S_COLOR_RED "^1"
+#define S_COLOR_RED "^1"
#define S_COLOR_GREEN "^2"
#define S_COLOR_YELLOW "^3"
#define S_COLOR_BLUE "^4"