diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-03-28 17:31:01 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-03-28 17:31:01 -0400 |
commit | 05b694028e0537954ea2d5e69774e0c24bf9ab47 (patch) | |
tree | 50933074aea2e442ea27677be498e8b071914d2a /src/stdio/__uflow.c | |
parent | e3cd6c5c265cd481db6e0c5b529855d99f0bda30 (diff) | |
download | musl-05b694028e0537954ea2d5e69774e0c24bf9ab47.tar.gz musl-05b694028e0537954ea2d5e69774e0c24bf9ab47.tar.bz2 musl-05b694028e0537954ea2d5e69774e0c24bf9ab47.tar.xz musl-05b694028e0537954ea2d5e69774e0c24bf9ab47.zip |
fix getc - the classic error of trying to store EOF+0-255 in a char type..
Diffstat (limited to 'src/stdio/__uflow.c')
-rw-r--r-- | src/stdio/__uflow.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/stdio/__uflow.c b/src/stdio/__uflow.c index 544dda98..e28922c2 100644 --- a/src/stdio/__uflow.c +++ b/src/stdio/__uflow.c @@ -5,7 +5,7 @@ int __uflow(FILE *f) { - unsigned char c = EOF; - if (f->rend || !__toread(f)) f->read(f, &c, 1); - return c; + unsigned char c; + if ((f->rend || !__toread(f)) && f->read(f, &c, 1)==1) return c; + return EOF; } |