From 2415d22c7a82396daf21dabe6191531cfa21e6a3 Mon Sep 17 00:00:00 2001 From: Anastasis Grammenos Date: Tue, 13 Nov 2018 14:12:58 +0200 Subject: Make conf vars mandatory --- src/confparser.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/confparser.c') diff --git a/src/confparser.c b/src/confparser.c index f6ea3a0..8547867 100644 --- a/src/confparser.c +++ b/src/confparser.c @@ -90,6 +90,15 @@ int config_file_parse(Conf *conf, UserOpt *opt) { return -1; } } + /* Could add an optional row that would make the config var + * optional. */ +#define X(var, str, name) \ + if (!conf->var) { \ + ERR("Missing %s", name); \ + return -1; \ + } + CONFIG_VARIABLES_TABLE +#undef X return 0; } -- cgit v1.2.3