| commit | 72656157f54c47277b01ec85a6ba7c4084fea6c8 | [log] [tgz] | 
|---|---|---|
| author | Szabolcs Nagy <nsz@port70.net> | Sat Nov 18 16:51:48 2017 | 
| committer | Rich Felker <dalias@aerifal.cx> | Sun Nov 19 01:11:08 2017 | 
| tree | 971a42bacaaae0a5f48f3b72d59ad6b7aeae3666 | |
| parent | a223dbd27ae36fe53f9f67f86caf685b729593fc [diff] | 
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 e455cfe..a00c1a8 100644 --- a/src/stdio/fgetwc.c +++ b/src/stdio/fgetwc.c
@@ -22,6 +22,7 @@ f->rpos++; return WEOF; } + f->rpos = f->rend; } else l = -2; /* Convert character byte-by-byte */