From e9a8759bcc696d78ce9d8187e263cfd90c96fdef Mon Sep 17 00:00:00 2001 From: Ondrej Kos Date: Wed, 3 Apr 2013 13:25:28 +0200 Subject: INI: Remove dead code https://fedorahosted.org/sssd/ticket/1857 Discovered by coverity The code was inaccessibile, if no key is present, the error will occur before this check. --- ini/ini_parse.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ini/ini_parse.c b/ini/ini_parse.c index 60ef116..9900610 100644 --- a/ini/ini_parse.c +++ b/ini/ini_parse.c @@ -970,6 +970,7 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action) /* Check if we have the key */ if (*(str) == '=') { + TRACE_ERROR_STRING("No key", str); po->last_error = ERR_NOKEY; *action = PARSE_ERROR; return EOK; @@ -990,12 +991,6 @@ static int handle_kvp(struct parser_obj *po, uint32_t *action) while ((len > 0) && (isspace(*(str + len)))) len--; /* Adjust length properly */ len++; - if (!len) { - TRACE_ERROR_STRING("No key", str); - po->last_error = ERR_NOKEY; - *action = PARSE_ERROR; - return EOK; - } /* Check the key length */ if(len >= MAX_KEY) { -- cgit