]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
iptables: Coverity: DEADCODE
authorJiri Popelka <jpopelka@redhat.com>
Fri, 10 Jun 2011 13:25:55 +0000 (15:25 +0200)
committerJan Engelhardt <jengelh@medozas.de>
Wed, 22 Jun 2011 13:53:33 +0000 (15:53 +0200)
libiptc.c:407: dead_error_condition: On this path, the condition
"res > 0" cannot be false.
libiptc.c:396: at_least: After this line, the value of "res" is at
least 1.
libiptc.c:393: equality_cond: Condition "res == 0" is evaluated as
false.
libiptc.c:396: new_values: Noticing condition "res < 0".
libiptc.c:425: new_values: Noticing condition "res < 0".
libiptc.c:407: new_values: Noticing condition "res > 0".
libiptc.c:435: dead_error_line: Execution cannot reach this statement
"return list_pos;".

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
libiptc/libiptc.c

index 0b6d5e3adf02c8e249701f09e94a527f5ef981b6..42d9784a491870d74a964563aab5ad279176fd73 100644 (file)
@@ -403,7 +403,7 @@ __iptcc_bsearch_chain_index(const char *name, unsigned int offset,
                }
                debug("jump back to pos:%d (end:%d)\n", pos, end);
                goto loop;
-       } else if (res > 0 ){ /* Not far enough, jump forward */
+       } else { /* res > 0; Not far enough, jump forward */
 
                /* Exit case: Last element of array */
                if (pos == handle->chain_index_sz-1) {
@@ -430,8 +430,6 @@ __iptcc_bsearch_chain_index(const char *name, unsigned int offset,
                debug("jump forward to pos:%d (end:%d)\n", pos, end);
                goto loop;
        }
-
-       return list_pos;
 }
 
 /* Wrapper for string chain name based bsearch */