From e5dff03902a109cd24f73b2a0001f2c08018d787 Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Mon, 27 Feb 2023 17:42:35 +0100 Subject: Put outside the condition to check if the line is a comment --- src/log.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/log.c b/src/log.c index 4eaf717..eccb4c8 100644 --- a/src/log.c +++ b/src/log.c @@ -96,8 +96,9 @@ log_init(Log *log) if (file == NULL) return; - while (fgets(buff, BUFF_SIZE, file) != NULL - && buff[0] != '#') { + while (fgets(buff, BUFF_SIZE, file) != NULL) { + /* Skip commented lines (very spartan comment) */ + if (buff[0] == '#') continue; sscanf(buff, "%[^=]=%s", conf_key, conf_value); log->level = log_get_level(log->tag, conf_key, conf_value); -- cgit v1.2.3