diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2004-10-26 18:21:09 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2004-10-26 18:21:09 +0000 |
commit | 65b1964f1afbd0a9faea38a4c546b2b5f67f6d20 (patch) | |
tree | 2c879353f841bcccb4174b58f7548ff6c50497cb | |
parent | 8876d8cbec35e3445adfb269220cbc3477e3db5a (diff) | |
download | cygnal-65b1964f1afbd0a9faea38a4c546b2b5f67f6d20.tar.gz cygnal-65b1964f1afbd0a9faea38a4c546b2b5f67f6d20.tar.bz2 cygnal-65b1964f1afbd0a9faea38a4c546b2b5f67f6d20.zip |
2004-10-26 Jason Tishler <jason@tishler.net>
* libc/stdio/fread.c (fread): Fix return value for unbuffered
fread.
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/stdio/fread.c | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 3b04973a4..03b989cee 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2004-10-26 Jason Tishler <jason@tishler.net> + + * libc/stdio/fread.c (fread): Fix return value for unbuffered + fread. + 2004-10-25 Ralf Corsepius <corsepiu@faw.uni-ulm.de> * libc/include/machine/setjmp.h: Add AVR support. diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c index fa3873075..e0faa3578 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -167,19 +167,15 @@ _DEFUN(fread, (buf, size, count, fp), fp->_bf._base = old_base; fp->_bf._size = old_size; fp->_p = old_p; - if (rc) - { - /* no more input: return partial result */ #ifdef __SCLE - if (fp->_flags & __SCLE) - { - _funlockfile (fp); - return crlf (fp, buf, total-resid, 1) / size; - } -#endif + if (fp->_flags & __SCLE) + { _funlockfile (fp); - return (total - resid) / size; + return crlf (fp, buf, total-resid, 1) / size; } +#endif + _funlockfile (fp); + return (total - resid) / size; } } else |