Simon Josefsson writes: > > OTOH, if the EOF marker is already set, should we really continue to > read from the stream? The function may take an already open stream, > that have been read from before. > > Perhaps the function should also test ferror outside of the loop...
If either the end-of-file or error indicators are set for the stream, the C Standard requires fread to immediately return 0 (aka "sticky" EOF). Most traditional implementations, however, do not do that. That said, I really don't care one way or the other what you do about it. :-) -Larry Jones I think if Santa is going to judge my behavior over the last year, I ought to be entitled to legal representation. -- Calvin