From 2f2e0290b39c80fed52696368d0e499df8c2bde8 Mon Sep 17 00:00:00 2001 From: TimeServ Date: Thu, 6 Apr 2006 08:42:24 +0000 Subject: [PATCH] attempt to fix extended code parsing git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2167 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_screen.c | 2 +- engine/common/console.h | 2 +- engine/server/sv_sys_unix.c | 2 +- engine/server/sv_sys_win.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_screen.c b/engine/client/cl_screen.c index c31d5db70..b82ffabe6 100644 --- a/engine/client/cl_screen.c +++ b/engine/client/cl_screen.c @@ -204,7 +204,7 @@ void CopyAndMarkup(conchar_t *dest, qbyte *src, int maxlength) } else if (*src == '&') // extended code { - if (isextendedcode(*src+1) && isextendedcode(*src+2)) + if (isextendedcode(src[1]) && isextendedcode(src[2])) { src++; // foreground char if (*src == '-') // default for FG diff --git a/engine/common/console.h b/engine/common/console.h index 5670620da..c0cea3a5f 100644 --- a/engine/common/console.h +++ b/engine/common/console.h @@ -85,7 +85,7 @@ extern conchar_t q3codemasks[MAXQ3COLOURS]; #define CON_TEXTSIZE 16384 -#define isextendedcode(x) (((x) >= '0' && (x) <= '9') || ((x) >= 'A' && (x) <= 'F') || (x) == '-') +#define isextendedcode(x) ((x >= '0' && x <= '9') || (x >= 'A' && x <= 'F') || x == '-') typedef struct console_s { diff --git a/engine/server/sv_sys_unix.c b/engine/server/sv_sys_unix.c index 6213efebf..e25e50e32 100644 --- a/engine/server/sv_sys_unix.c +++ b/engine/server/sv_sys_unix.c @@ -355,7 +355,7 @@ void Sys_Printf (char *fmt, ...) } else if (*str == '&') // extended code { - if (isextendedcode(*str+1) && isextendedcode(*str+2)) + if (isextendedcode(str[1]) && isextendedcode(str[2])) { str++; // foreground char if (*str == '-') // default for FG diff --git a/engine/server/sv_sys_win.c b/engine/server/sv_sys_win.c index 6917b39ba..b1cdcba93 100644 --- a/engine/server/sv_sys_win.c +++ b/engine/server/sv_sys_win.c @@ -563,7 +563,7 @@ void Sys_Printf (char *fmt, ...) } else if (*str == '&') // extended code { - if (isextendedcode(*str+1) && isextendedcode(*str+2)) + if (isextendedcode(str[1]) && isextendedcode(str[2])) { str++; // foreground char if (*str == '-') // default for FG