]> code.delx.au - pulseaudio/commitdiff
conf-parser: Remove redundant feof() call
authorTanu Kaskinen <tanuk@iki.fi>
Sat, 30 Jun 2012 09:58:40 +0000 (12:58 +0300)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 22 Mar 2013 19:14:08 +0000 (21:14 +0200)
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.

src/pulsecore/conf-parser.c

index 062fa8e5d09173f1869b5c593eee3b1d3fec1628..0c7444d718b5359abf692e2956ff65726e394d80 100644 (file)
@@ -185,9 +185,6 @@ int pa_config_parse(const char *filename, FILE *f, const pa_config_item *t, pa_p
 
     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;
         }