This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
Re: fscanf does not return EOF
- To: "Mumit Khan" <khan at NanoTech dot Wisc dot EDU>,"Uwe Pahner" <uwe dot pahner at esat dot kuleuven dot ac dot be>
- Subject: Re: fscanf does not return EOF
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- Date: Fri, 30 Mar 2001 14:53:52 +1000
- Cc: <cygwin at cygwin dot com>
- References: <Pine.HPP.3.96.1010329222253.29265D-100000@hp2.xraylith.wisc.edu>
----- Original Message -----
From: "Mumit Khan" <khan@NanoTech.Wisc.EDU>
To: "Uwe Pahner" <uwe.pahner@esat.kuleuven.ac.be>
Cc: <cygwin@cygwin.com>
Sent: Friday, March 30, 2001 2:31 PM
Subject: Re: fscanf does not return EOF
> On Thu, 29 Mar 2001, Uwe Pahner wrote:
>
> > Hi,
> >
>
> I suggest portable coding, where you read the lines one by one using
> fgets, checking for EOF, and if not, pass the line buffer it to
sscanf.
> Or, use fscanf, but check explicitly for eof on the stream when you
> see a return value of 0.
>
> I may of course be reading the specification wrong.
>
> Regards,
> Mumit
>
I think you're right: I am using fscanf in my fifo tests, and the first
iteration was written without checking the specs:].. as soon as I ran
man 3 fscanf on my opsnBSD machine (best man pages ever) I saw the same
point of confusion. Coding to the spec worked fine on cygwin.
Rob
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple