mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
wchar/lib_ungetwc: fix the array access out of bounds error
Signed-off-by: guoshichao <guoshichao@xiaomi.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user