* libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
lone high surrogate.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
+2015-04-01 Corinna Vinschen <vinschen@redhat.com>
+
+ * libc/stdlib/wctomb_r.c (__utf8_wctomb): Fix check for handling a
+ lone high surrogate.
+
2015-03-31 Corinna Vinschen <vinschen@redhat.com>
* libc/time/lcltime_r.c (localtime_r): Call _tzset_unlocked inside
return 0; /* UTF-8 encoding is not state-dependent */
if (sizeof (wchar_t) == 2 && state->__count == -4
- && (wchar < 0xdc00 || wchar >= 0xdfff))
+ && (wchar < 0xdc00 || wchar > 0xdfff))
{
/* There's a leftover lone high surrogate. Write out the CESU-8 value
of the surrogate and proceed to convert the given character. Note
- Avoid potential crash at startup or in getgroups(2).
Addresses: https://cygwin.com/ml/cygwin/2015-04/msg00010.html
+
+- Fix UTF-16 surrogate handling in wctomb and friends.
+ Addresses: https://cygwin.com/ml/cygwin/2015-03/msg00452.html