mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 13:11:00 +00:00
[console] Avoid reliance on signedness of char
It turns out char defaults to unsigned on arm (using gcc, at least). Avoid the issue completely by checking the bit rather than the sign.
This commit is contained in:
parent
f3d3bc8ec1
commit
bdac574e69
1 changed files with 1 additions and 1 deletions
|
@ -494,7 +494,7 @@ C_Print (const char *fmt, va_list args)
|
||||||
char *s = c_print_buffer->str;
|
char *s = c_print_buffer->str;
|
||||||
|
|
||||||
bool quake_encoding = s[0] > 0 && s[0] <= 3;
|
bool quake_encoding = s[0] > 0 && s[0] <= 3;
|
||||||
bool colored = quake_encoding && s[0] < 0;
|
bool colored = quake_encoding && (s[0] & 0x80);
|
||||||
int mask = (colored ? 128 : 0) | con_data.ormask;
|
int mask = (colored ? 128 : 0) | con_data.ormask;
|
||||||
s += quake_encoding;
|
s += quake_encoding;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue