[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:
Bill Currie 2024-04-24 08:30:37 +09:00
parent f3d3bc8ec1
commit bdac574e69

View file

@ -494,7 +494,7 @@ C_Print (const char *fmt, va_list args)
char *s = c_print_buffer->str;
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;
s += quake_encoding;