flatmush / dingoo-sdk

Automatically exported from code.google.com/p/dingoo-sdk
2 stars 3 forks source link

Non-standard behavior in fgetc/feof #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
fgetc and/or feof is behaving wrong when using code like this:

while( !feof( f ) )
{
    fgetc( f );
    ++len;
}
return len-1;

The problem seems to be that when successfully reading the last char with 
fgetc, EOF is set. It should not be set by fgetc until it fails to read.

Original issue reported on code.google.com by hart...@gmail.com on 29 Jul 2010 at 4:14

Attachments:

GoogleCodeExporter commented 9 years ago
Seems to be fixed in r309.
The attached testcase now works as intended, but I'll keep this open one or a 
few days because I'm going to do some additional testing and improve the test 
application.

Original comment by hart...@gmail.com on 12 Feb 2011 at 1:35

GoogleCodeExporter commented 9 years ago
Test case work and still works in the fixed r315. For the additional stdio 
testing, I opened a new issue (Issue 59).

Original comment by hart...@gmail.com on 13 Feb 2011 at 4:45