wchar/lib_ungetwc: fix the array access out of bounds error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
parent
9876b0b615
commit
ca1e007a22
@ -70,7 +70,7 @@ wint_t ungetwc_unlocked(wint_t wc, FAR FILE *f)
|
||||
|
||||
/* Try conversion early so we can fail without locking if invalid */
|
||||
|
||||
if ((l = wctomb(mbc, wc)) < 0)
|
||||
if ((l = wctomb(mbc, wc)) <= 0)
|
||||
{
|
||||
return WEOF;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user