From 4cd3da2019b53aa122b4fea4b43b6b311150dbdf Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Tue, 23 Apr 2013 18:56:38 +0100 Subject: [PATCH] PDCLIB-2 c16rtomb never cleared _Surrogate --- functions/uchar/c16rtomb.c | 1 + 1 file changed, 1 insertion(+) diff --git a/functions/uchar/c16rtomb.c b/functions/uchar/c16rtomb.c index e8f1de7..6e3a27c 100644 --- a/functions/uchar/c16rtomb.c +++ b/functions/uchar/c16rtomb.c @@ -58,6 +58,7 @@ size_t c16rtomb_l( if((c16 & 0xFC00) == 0xDC00) { // Trailing surrogate char32_t c32 = (ps->_Surrogate & 0x3FF) << 10 | (c16 & 0x3FF); + ps->_Surrogate = 0; return c32rtomb_l(s, c32, ps, l); } else { // Not a trailing surrogate - encoding error -- 2.40.0