summaryrefslogtreecommitdiff
path: root/src/stdio/fgetwc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/fgetwc.c')
-rw-r--r--src/stdio/fgetwc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/fgetwc.c b/src/stdio/fgetwc.c
index 07fb6d7c..0801e28f 100644
--- a/src/stdio/fgetwc.c
+++ b/src/stdio/fgetwc.c
@@ -10,7 +10,7 @@ static wint_t __fgetwc_unlocked_internal(FILE *f)
size_t l;
/* Convert character from buffer if possible */
- if (f->rpos < f->rend) {
+ if (f->rpos != f->rend) {
l = mbtowc(&wc, (void *)f->rpos, f->rend - f->rpos);
if (l+1 >= 1) {
f->rpos += l + !l; /* l==0 means 1 byte, null */