diff --git a/config.c b/config.c index 42c2ba2..14d783f 100644 --- a/config.c +++ b/config.c @@ -187,7 +187,7 @@ init_conf(void) static cfg_opt_t key_opts[] = { - CFG_STR_LIST("mod","{Control}", CFGF_NONE), + CFG_STR_LIST("mod", "{Control}", CFGF_NONE), CFG_STR("key", "None", CFGF_NONE), CFG_STR("func", "", CFGF_NONE), CFG_STR("cmd", "", CFGF_NONE), @@ -318,6 +318,13 @@ init_conf(void) /* tag */ conf.ntag = cfg_size(cfg_tags, "tag"); + + if(!conf.ntag) + { + printf("WMFS Configuration: There is no tags in the configuration file\n"); + exit(EXIT_FAILURE); + } + for(i = 0; i < conf.ntag; ++i) { cfgtmp = cfg_getnsec(cfg_tags, "tag", i); diff --git a/wmfs.c b/wmfs.c index 09e25bd..6c455ab 100644 --- a/wmfs.c +++ b/wmfs.c @@ -968,7 +968,8 @@ tag(char *cmd) } else { - if(tmp == seltag) + if(tmp == seltag + || tmp > conf.ntag) return; seltag = tmp; }