This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
bug in ferror
- From: Stephen Polkowski <stephen at centtech dot com>
- To: eocs <ecos-discuss at sources dot redhat dot com>
- Date: Fri, 07 Jun 2002 14:02:13 -0500
- Subject: [ECOS] bug in ferror
Hi all,
I think I've discovered a bug in ferror. ferror() is return 1 for EOF.
ferror() should return 0 for EOF. This is messing up a lex parser that
was generated by flex. The ferror routine should check for EOF before
returning an error.
Here's my update to ferror:
/ecos/packages/language/c/libc/stdio/current/src/common/feof.cxx: line 64
externC int
ferror( FILE *stream )
{
Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream;
// EOF is not an error
if (real_stream->get_eof_state() != 0) return 0;
return (real_stream->get_error() != 0);
} // ferror()
--
Stephen Polkowski
Centaur Technology
Austin, TX
(512) 418-5730
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss