From ba3f3a17d344a549e233f3b8865e2925edfd5238 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 12 Mar 2017 21:03:38 +0100 Subject: [PATCH] require that main.c declare any ini variables that we might expect. --- src/kernel/config.c | 21 ++++------------- src/kernel/config.h | 2 +- src/kernel/config.test.c | 2 +- src/main.c | 50 +++++++++++++++++++++++++--------------- 4 files changed, 38 insertions(+), 37 deletions(-) diff --git a/src/kernel/config.c b/src/kernel/config.c index 4d4a0e601..67dddb11e 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -732,19 +732,8 @@ bool config_changed(int *cache_key) { return false; } -static const char * valid_keys[] = { - "game.id", - "game.name", - "game.locale", - "game.verbose", - "game.email", - "game.mailcmd", - "game.sender", - NULL -}; - #define MAXKEYS 16 -void config_set_from(const dictionary *d) +void config_set_from(const dictionary *d, const char *valid_keys[]) { int s, nsec = iniparser_getnsec(d); for (s=0;s!=nsec;++s) { @@ -753,7 +742,6 @@ void config_set_from(const dictionary *d) int k, nkeys = iniparser_getsecnkeys(d, sec); const char *keys[MAXKEYS]; size_t slen = strlen(sec); - bool check = strcmp(sec, "game") == 0; assert(nkeys <= MAXKEYS); assert(slen