0

When I open a file, the file is valid (passes if (!file)). But when I use it with fgets, fgets fails. When I called ferror the return value is 32. I looked that up and it means broken pipe. What does this mean and how could I fix it?

This is my code:

FILE *f = fopen ("q1/config.cfg","w");
int i;
while (fgets(buff, 1024, f))
	if (buff[0] != '/' && buff[1] != '/')
		Cmd_ExecuteString (buff);
i = ferror (f);

Edited by tomtetlaw: n/a

2
Contributors
4
Replies
6
Views
7 Years
Discussion Span
Last Post by tomtetlaw
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.