From c108b893d21cef56f5515e94137c5942f4684158 Mon Sep 17 00:00:00 2001 From: NaitLee Date: Mon, 10 Jul 2023 22:15:04 +0800 Subject: [PATCH] (wtf8) wrap 4-bytes-sequence detection in ifdef U32 Signed-off-by: NaitLee --- utf8lib.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.39.2