From 4b31522fdf67e5d8f6e34540e62145d570032095 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sun, 15 Feb 2015 12:48:46 +0100 Subject: [PATCH] complain about excess values supplied to options --- src/config.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/config.c b/src/config.c index fb9dc5f..1c181ce 100644 --- a/src/config.c +++ b/src/config.c @@ -236,8 +236,13 @@ getopt_helper( conffile_t *cfile, int *cops, channel_conf_t *conf ) int getcline( conffile_t *cfile ) { + char *arg; int comment; + if (cfile->rest && (arg = get_arg( cfile, ARG_OPTIONAL, 0 ))) { + error( "%s:%d: excess token '%s'\n", cfile->file, cfile->line, arg ); + cfile->err = 1; + } while (fgets( cfile->buf, cfile->bufl, cfile->fp )) { cfile->line++; cfile->rest = cfile->buf; @@ -337,6 +342,7 @@ load_config( const char *where, int pseudo ) cfile.bufl = sizeof(buf) - 1; cfile.line = 0; cfile.err = 0; + cfile.rest = 0; gcops = 0; global_conf.expire_unread = -1;