Piping file through my program gives "Broken Pipe"?!

uCsDNerd

Senior member
Mar 3, 2001
338
0
0
Hi guys. I'm running a C program under Unix Solaris. Basically the file that I'm piping through my program is a bunch of numbers in each line, such as:

% 4 43FFD321 10
% 4 42DDE622 5
...
..

Anyhow, my program takes in each line from this file and reads the input through a:
scanf( " %c %d %lx %d ..." , .... );
anyhow, I know my scanf line is correct, the professor gave it to me. And I was told that my while loop:
while( scanf( .... ) != EOF ) { ... } was also correct in detecting the end of the file ( end of input ).

However, through a series of fprintf( stderr, ... ) statements, I've been able to determine that the program does indeed run and execute properly, a couple of hundred lines of from the file, but after a few thousand my program halts and gives me a "Broken Pipe" message.

Anyhow, anybody know what that means and possibly what in my program may be causing this to happen? Thanks.