From: Ari Johnson Date: Thu, 28 Apr 2011 16:05:55 +0000 (-0500) Subject: Actually use fgets() return value in conf.c and silence warnings about ignoring it X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=650100b1b35f3e78c7ecc17854b7f0074aa83ae8;p=cobramush.git Actually use fgets() return value in conf.c and silence warnings about ignoring it --- diff --git a/src/conf.c b/src/conf.c index 84a2c7d..c64a09d 100644 --- a/src/conf.c +++ b/src/conf.c @@ -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