diff options
author | Anastasis Grammenos <anastasis.gramm2@gmail.com> | 2018-11-13 14:12:58 +0200 |
---|---|---|
committer | Anastasis Grammenos <anastasis.gramm2@gmail.com> | 2018-11-13 14:12:58 +0200 |
commit | 2415d22c7a82396daf21dabe6191531cfa21e6a3 (patch) | |
tree | 5c6d03148833c3c7d1c0d11c9bfcf876028e1e24 /src/confparser.c | |
parent | 6a43f7bfdfdb693e877943490abd5839a630ad9d (diff) | |
download | ck-2415d22c7a82396daf21dabe6191531cfa21e6a3.tar.gz ck-2415d22c7a82396daf21dabe6191531cfa21e6a3.tar.bz2 ck-2415d22c7a82396daf21dabe6191531cfa21e6a3.zip |
Make conf vars mandatory
Diffstat (limited to 'src/confparser.c')
-rw-r--r-- | src/confparser.c | 9 |
1 files changed, 9 insertions, 0 deletions
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; } |