From 650100b1b35f3e78c7ecc17854b7f0074aa83ae8 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Thu, 28 Apr 2011 11:05:55 -0500 Subject: [PATCH] Actually use fgets() return value in conf.c and silence warnings about ignoring it --- src/conf.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) 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 -- 2.30.2