Date: Fri, 18 Jul 1997 09:20:28 -0700 (PDT) Message-Id: <199707181620.JAA02352@adit.ap.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" To: djgpp AT delorie DOT com From: Nate Eldredge Subject: Re: fread/fwite return value Precedence: bulk A. Sinan Unur wrote: >heretic AT polbox DOT com wrote: >> So, I wanted to have error checking and I wrote something like >> >> if ( fread(blah,blah,blah) == -1 ) >> { >> oh_no_error (); >> } >> > >i think it is an error in the docs. AFAIK, fread is supposed to return >0, not EOF, precisely because the return value is size_t, and 0 >signifies no bytes read. Well, AFAIK, fread is an ANSI function, so the standard should be able to bring enlightenment. Can someone with a copy help us out here? Nate Eldredge eldredge AT ap DOT net