am 94a4a173: am 59936a3b: Merge "Fix optimized fread."

* commit '94a4a173d24ce8feac5c49fb5ad209a836d41439':
  Fix optimized fread.
This commit is contained in:
Elliott Hughes
2015-01-24 21:38:15 +00:00
committed by Android Git Automerger
2 changed files with 56 additions and 2 deletions

View File

@@ -120,7 +120,7 @@ fread(void *buf, size_t size, size_t count, FILE *fp)
while (total > 0) {
ssize_t bytes_read = (*fp->_read)(fp->_cookie, dst, total);
if (bytes_read <= 0) {
fp->_flags = (fp->_r == 0) ? __SEOF : __SERR;
fp->_flags |= (bytes_read == 0) ? __SEOF : __SERR;
break;
}
dst += bytes_read;