Actually use fgets() return value in conf.c and silence warnings about ignoring it
authorAri Johnson <ari@theari.com>
Thu, 28 Apr 2011 16:05:55 +0000 (11:05 -0500)
committerAri Johnson <ari@theari.com>
Thu, 28 Apr 2011 16:05:55 +0000 (11:05 -0500)
src/conf.c

index 84a2c7db07af064210f0d8f0829fae3ddeb2d771..c64a09dc972f80a5d70315c2d46f2c5ce45196be 100644 (file)
@@ -1383,14 +1383,11 @@ config_file_startup(const char *conf, int restrictions)
     do_rawlog(LT_ERR, "Reading %s", conf);
   }
 
-  fgets(tbuf1, BUFFER_LEN, fp);
-  while (!feof(fp)) {
-
-    p = tbuf1;
-
+  p = fgets(tbuf1, BUFFER_LEN, fp);
+  while (p && !feof(fp)) {
     if (*p == '#') {
       /* comment line */
-      fgets(tbuf1, BUFFER_LEN, fp);
+      p = fgets(tbuf1, BUFFER_LEN, fp);
       continue;
     }
     /* this is a real line. Strip the end-of-line and characters following it.
@@ -1439,7 +1436,7 @@ config_file_startup(const char *conf, int restrictions)
       } else
         config_set(p, q, 0, restrictions);
     }
-    fgets(tbuf1, BUFFER_LEN, fp);
+    p = fgets(tbuf1, BUFFER_LEN, fp);
   }
 
   /* Warn about any config options that aren't overridden by the