X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstdio%2F__uflow.c;h=2a88bca6b123cc2143911783a09a9cac0ce53773;hb=6aeb9c6703670649ee09b3c8575fb428168bb75c;hp=5a51d6102a9a073f4cf31184eed5628e1b2728ba;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/__uflow.c b/src/stdio/__uflow.c index 5a51d610..2a88bca6 100644 --- a/src/stdio/__uflow.c +++ b/src/stdio/__uflow.c @@ -1,7 +1,11 @@ #include "stdio_impl.h" +/* This function assumes it will never be called if there is already + * data buffered for reading. */ + int __uflow(FILE *f) { - if (__underflow(f) < 0) return EOF; - else return *f->rpos++; + unsigned char c; + if (!__toread(f) && f->read(f, &c, 1)==1) return c; + return EOF; }