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 != '/' && buff != '/') Cmd_ExecuteString (buff); i = ferror (f);