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.
This commit is contained in:
Szabolcs Nagy 2017-11-18 17:51:48 +01:00 committed by Rich Felker
parent a223dbd27a
commit 72656157f5
1 changed files with 1 additions and 0 deletions

View File

@ -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 */