mirror of
https://github.com/apache/nuttx.git
synced 2025-01-13 08:38:38 +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:
parent
9876b0b615
commit
ca1e007a22
1 changed files with 1 additions and 1 deletions
|
@ -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 a new issue