aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-27 17:42:35 +0100
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2023-02-27 17:42:35 +0100
commite5dff03902a109cd24f73b2a0001f2c08018d787 (patch)
tree7d98455098aaf5bc2afff9f29f0b7ca9f84a9e2e
parentcde9fcf3deaa47d31b73cb943847a099704b9179 (diff)
downloadlog-e5dff03902a109cd24f73b2a0001f2c08018d787.tar.gz
log-e5dff03902a109cd24f73b2a0001f2c08018d787.zip
Put outside the condition to check if the line is
a comment
-rw-r--r--src/log.c5
1 files 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);