> Maybe that's it. Maybe 'fgets' is interfering with how scanf works.
> Does it still fail if you remove the 'fgets' from the for loop?
Yes, it still fails. I tried removing the #define from the start of the
string to be matched, though, and it no longer fails. OTOH, the original
program (which i
On Thu, 7 Dec 1995, brian (b.c.) white wrote:
> > for (ksnum=0; 1; c=fgets(buf,sizeof(buf),stdin)) {
>
> The third thing in the "for" structure only gets executed at end of
> the loop. 'c' thus has an undefined value on the first iteration
> which just happened to be NULL for you (hence the "(ni
Package: libc5
Version: 5.2.16-1
(My libc5-dev version is also 5.2.16-1)
The following program (which is similar in structure to one of the
programs used in building xlib) loops forever when it reaches EOF on stdin:
#include
int main(int argc, char **argv)
{
int ksnum,i;
char buf[1024];
3 matches
Mail list logo