diff options
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/locale/utf8.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index 8421680..02b1ccc 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -146,18 +146,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mask = 0x07; want = 4; lbound = 0x10000; -#if 0 - /* These would be illegal in the UTF-8 space */ - - } else if ((ch & 0xfc) == 0xf8) { - mask = 0x03; - want = 5; - lbound = 0x200000; - } else if ((ch & 0xfe) == 0xfc) { - mask = 0x01; - want = 6; - lbound = 0x4000000; -#endif } else { /* * Malformed input; input is not UTF-8. @@ -327,18 +315,9 @@ _UTF8_wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps) } else if ((wc & ~0xffff) == 0) { lead = 0xe0; len = 3; - } else if ((wc & ~0x1fffff) == 0) { + } else if (wc >= 0 && wc <= 0x10ffff) { lead = 0xf0; len = 4; -#if 0 - /* Again, 5 and 6 byte encodings are simply not permitted */ - } else if ((wc & ~0x3ffffff) == 0) { - lead = 0xf8; - len = 5; - } else if ((wc & ~0x7fffffff) == 0) { - lead = 0xfc; - len = 6; -#endif } else { errno = EILSEQ; return ((size_t)-1); |