fgets() returns NULL in case there's an error or f is at EOF. The
while condition just checked that f is not at EOF, therefore an error
must have happened.
while (!feof(f)) {
if (!fgets(state.buf, sizeof(state.buf), f)) {
while (!feof(f)) {
if (!fgets(state.buf, sizeof(state.buf), f)) {
- if (feof(f))
- break;
-
pa_log_warn("Failed to read configuration file '%s': %s", filename, pa_cstrerror(errno));
goto finish;
}
pa_log_warn("Failed to read configuration file '%s': %s", filename, pa_cstrerror(errno));
goto finish;
}