wchar/putwc: fix the putwc return value truncate error

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

View File

@ -76,10 +76,11 @@ wint_t putwc_unlocked(wchar_t c, FAR FILE *f)
wint_t putwc(wchar_t c, FAR FILE *f) wint_t putwc(wchar_t c, FAR FILE *f)
{ {
wint_t wc;
flockfile(f); flockfile(f);
c = putwc_unlocked(c, f); wc = putwc_unlocked(c, f);
funlockfile(f); funlockfile(f);
return c; return wc;
} }
#endif /* CONFIG_FILE_STREAM */ #endif /* CONFIG_FILE_STREAM */