From: NaitLee Date: Mon, 10 Jul 2023 14:15:04 +0000 (+0800) Subject: (wtf8) wrap 4-bytes-sequence detection in ifdef U32 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c108b893d21cef56f5515e94137c5942f4684158;p=xonotic%2Fdarkplaces.git (wtf8) wrap 4-bytes-sequence detection in ifdef U32 Signed-off-by: NaitLee --- diff --git a/utf8lib.c b/utf8lib.c index 18b5e09d..1e34e707 100644 --- a/utf8lib.c +++ b/utf8lib.c @@ -975,12 +975,15 @@ int fromwtf8(const char *cstr, int clen, wchar *wstr, int maxwlen) if ((byte & 0xf8) == 0xf8) return -1; #endif + #if WTF8U32 if ((byte & 0xf8) == 0xf0) { length = 4; point = byte & 0x07; } - else if ((byte & 0xf0) == 0xe0) + else + #endif + if ((byte & 0xf0) == 0xe0) { length = 3; point = byte & 0x0f;