summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Kos <okos@redhat.com>2013-04-03 13:25:28 +0200
committerOndrej Kos <okos@redhat.com>2013-04-05 13:15:18 +0200
commite9a8759bcc696d78ce9d8187e263cfd90c96fdef (patch)
tree5536f37836ed3a07ec3d3b48f22958ef8f726dfe
parent3d3056b38061386a49ca793e08ce52e8c5562f46 (diff)
downloadding-libs-e9a8759bcc696d78ce9d8187e263cfd90c96fdef.zip
ding-libs-e9a8759bcc696d78ce9d8187e263cfd90c96fdef.tar.gz
ding-libs-e9a8759bcc696d78ce9d8187e263cfd90c96fdef.tar.xz
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.
-rw-r--r--ini/ini_parse.c7
1 files changed, 1 insertions, 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) {