Allow reading 0 bytes in fread.

This commit is contained in:
Felix Nawothnig 2005-07-10 17:46:08 +00:00 committed by Alexandre Julliard
parent 2d7e976eed
commit 30e248ff90
1 changed files with 3 additions and 0 deletions

View File

@ -2482,6 +2482,9 @@ MSVCRT_size_t MSVCRT_fread(void *ptr, MSVCRT_size_t size, MSVCRT_size_t nmemb, M
MSVCRT_size_t read=0;
int pread=0;
if(!rcnt)
return 0;
/* first buffered data */
if(file->_cnt>0) {
int pcnt= (rcnt>file->_cnt)? file->_cnt:rcnt;