X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffgetwc.c;h=6f9f9ec21f8351cecf5131db636f8600364e8fab;hb=aaa9eb5101e3a748218fb9373dd9655b50582da2;hp=c990545f85b73690544b8e6d061833e23493e9b6;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/fgetwc.c b/src/stdio/fgetwc.c index c990545f..6f9f9ec2 100644 --- a/src/stdio/fgetwc.c +++ b/src/stdio/fgetwc.c @@ -12,7 +12,7 @@ wint_t __fgetwc_unlocked(FILE *f) /* Convert character from buffer if possible */ if (f->rpos < f->rend) { - l = mbrtowc(&wc, f->rpos, f->rend - f->rpos, &st); + l = mbrtowc(&wc, (void *)f->rpos, f->rend - f->rpos, &st); if (l+2 >= 2) { f->rpos += l + !l; /* l==0 means 1 byte, null */ return wc; @@ -23,18 +23,17 @@ wint_t __fgetwc_unlocked(FILE *f) } } else l = -2; - /* Convert character byte-by-byte from __uflow */ + /* Convert character byte-by-byte */ while (l == -2) { - b = c = __uflow(f); + b = c = getc_unlocked(f); if (c < 0) { if (!mbsinit(&st)) errno = EILSEQ; return WEOF; } - l = mbrtowc(&wc, &b, 1, &st); + l = mbrtowc(&wc, (void *)&b, 1, &st); if (l == -1) return WEOF; } - FUNLOCK(f); return wc; }