summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsemarie <semarie@openbsd.org>2015-09-26 14:22:40 +0000
committersemarie <semarie@openbsd.org>2015-09-26 14:22:40 +0000
commit93d2e2ca83a2efb303d75faa62c2a9a370a5ab9e (patch)
tree892043a5ac317bcf16ff5c50b6b5c9469d6cb805
parentApparently Valleyview / Bay Trail has 32-bit BARs, so fetch the type instead (diff)
downloadwireguard-openbsd-93d2e2ca83a2efb303d75faa62c2a9a370a5ab9e.tar.xz
wireguard-openbsd-93d2e2ca83a2efb303d75faa62c2a9a370a5ab9e.zip
correct a range problem in citrus-utf8 version of wcrtomb(3), in order to match
RFC 3629 (limiting the range of UTF-8 to 0x10FFFF). it is the counterpart of a previous commit correcting mbrtowc(3). problem spotted by stsp ok bentley@ stsp@
-rw-r--r--lib/libc/citrus/citrus_utf8.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/citrus/citrus_utf8.c b/lib/libc/citrus/citrus_utf8.c
index 45e5faf39b9..b6461b09c86 100644
--- a/lib/libc/citrus/citrus_utf8.c
+++ b/lib/libc/citrus/citrus_utf8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: citrus_utf8.c,v 1.10 2015/09/05 15:22:04 semarie Exp $ */
+/* $OpenBSD: citrus_utf8.c,v 1.11 2015/09/26 14:22:40 semarie Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins
@@ -313,7 +313,7 @@ _citrus_utf8_ctype_wcrtomb(char * __restrict s,
} else if ((wc & ~0xffff) == 0) {
lead = 0xe0;
len = 3;
- } else if ((wc & ~0x1fffff) == 0) {
+ } else if ((wc & ~0x10ffff) == 0) {
lead = 0xf0;
len = 4;
} else {