X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fstdio%2F__uflow.c;h=2a88bca6b123cc2143911783a09a9cac0ce53773;hb=7c0c7a75ec8ecf3eedefc40bb4dae5aaa76d7108;hp=544dda982dbf0abf4ae703825d91e84ffd2bd94a;hpb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;p=musl diff --git a/src/stdio/__uflow.c b/src/stdio/__uflow.c index 544dda98..2a88bca6 100644 --- a/src/stdio/__uflow.c +++ b/src/stdio/__uflow.c @@ -1,11 +1,11 @@ #include "stdio_impl.h" -/* This function will never be called if there is already data - * buffered for reading. Thus we can get by with very few branches. */ +/* This function assumes it will never be called if there is already + * data buffered for reading. */ int __uflow(FILE *f) { - unsigned char c = EOF; - if (f->rend || !__toread(f)) f->read(f, &c, 1); - return c; + unsigned char c; + if (!__toread(f) && f->read(f, &c, 1)==1) return c; + return EOF; }