From bdac574e690eb796e221a1e1b344b43878435646 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 24 Apr 2024 08:30:37 +0900 Subject: [PATCH] [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. --- libs/console/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/console/client.c b/libs/console/client.c index 714d2efee..0eded1c75 100644 --- a/libs/console/client.c +++ b/libs/console/client.c @@ -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;