From: Szabolcs Nagy Date: Sat, 18 Nov 2017 16:51:48 +0000 (+0100) Subject: fix fgetwc when decoding a character that crosses buffer boundary X-Git-Tag: v1.1.19~45 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=72656157f54c47277b01ec85a6ba7c4084fea6c8;p=oweals%2Fmusl.git fix fgetwc when decoding a character that crosses buffer boundary Update the buffer position according to the bytes consumed into st when decoding an incomplete character at the end of the buffer. --- diff --git a/src/stdio/fgetwc.c b/src/stdio/fgetwc.c index e455cfec..a00c1a86 100644 --- a/src/stdio/fgetwc.c +++ b/src/stdio/fgetwc.c @@ -22,6 +22,7 @@ static wint_t __fgetwc_unlocked_internal(FILE *f) f->rpos++; return WEOF; } + f->rpos = f->rend; } else l = -2; /* Convert character byte-by-byte */