X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fuchar%2Fc16rtomb.c;h=6e3a27cfd5add2eef9dfe50d11a855b8fe43433e;hb=7d481cb7bb4a37865e66c110b87476e8df04e690;hp=e8f1de780597eb44d4e0b3c6a4356e9bd89f5ba6;hpb=db384a5b4db8611b58a125a1f8504a3785f26566;p=pdclib 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