wchar/fgetwc: fix the return value truncate error

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
guoshichao 2024-04-25 19:10:14 +08:00 committed by Xiang Xiao
parent 390275f867
commit 9876b0b615

View File

@ -69,7 +69,8 @@ wint_t fgetwc_unlocked(FAR FILE *f)
while (l == -2)
{
b = c = getc_unlocked(f);
c = getc_unlocked(f);
b = (char)c;
if (c < 0)
{
if (!mbsinit(&st))