diff --git a/libs/libc/stdio/lib_ungetwc.c b/libs/libc/stdio/lib_ungetwc.c index d9f81c6d17..d3ea7bc53b 100644 --- a/libs/libc/stdio/lib_ungetwc.c +++ b/libs/libc/stdio/lib_ungetwc.c @@ -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; }