From 639dab228643d6807cfdea9f9db0e4535a027c30 Mon Sep 17 00:00:00 2001 From: Tom Rhodes Date: Thu, 30 Mar 2006 09:04:12 +0000 Subject: Fix a bug where, for 6-byte sequences, the top 6 bits get compared to 111111 rather than the top 7 bits being compared against 1111110 causing illegal bytes fe and ff being treated the same as legal bytes fc and fd. --- lib/libc/locale/utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/locale') diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 2f537a5b6ec9..e467fc053390 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -140,7 +140,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mask = 0x03; want = 5; lbound = 0x200000; - } else if ((ch & 0xfc) == 0xfc) { + } else if ((ch & 0xfe) == 0xfc) { mask = 0x01; want = 6; lbound = 0x4000000; -- cgit v1.2.3