summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-08-09 00:06:56 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-08-09 00:06:56 +0000
commit8bb93485fb51aac423ec000aa292815cf50bb02c (patch)
tree09b976e438db48b8cec0e5b842b3bd90936d3a8f
parentc9d24bcfd5c2f9940f1731f2747094951dbd1968 (diff)
Notes
-rw-r--r--lib/libc/locale/utf8.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c
index 843d59f77c54..55e29319c622 100644
--- a/lib/libc/locale/utf8.c
+++ b/lib/libc/locale/utf8.c
@@ -320,15 +320,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;
- } else if ((wc & ~0x3ffffff) == 0) {
- lead = 0xf8;
- len = 5;
- } else if ((wc & ~0x7fffffff) == 0) {
- lead = 0xfc;
- len = 6;
} else {
errno = EILSEQ;
return ((size_t)-1);