From 422a778ecee46225d139d512fe99768d670a9c0e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 8 Nov 2013 19:35:04 +0100 Subject: [PATCH] conf: eliminate local variable "match_found" --- src/conf.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/conf.c b/src/conf.c index f9b6918..0166f6f 100644 --- a/src/conf.c +++ b/src/conf.c @@ -378,7 +378,6 @@ parse_line(char *line) size_t len = strlen(line), i = 0, j = 0; char name[MAX_LINE_LENGTH]; char value[MAX_LINE_LENGTH]; - bool match_found; /* get the name part */ while (i < len && line[i] != '=' && !g_ascii_isspace(line[i])) @@ -396,8 +395,6 @@ parse_line(char *line) value[j++] = line[i++]; value[j] = '\0'; - match_found = true; - /* key definition */ if (!strcasecmp(CONF_KEY_DEFINITION, name)) parse_key_definition(value); @@ -557,13 +554,12 @@ parse_line(char *line) #else options.second_column = str2bool(value); #endif - else - match_found = false; - - if (!match_found) + else { print_error(_("Unknown configuration parameter"), name); + return false; + } - return match_found; + return true; } static int -- 2.30.2