]> The Tcpdump Group git mirrors - tcpdump/commitdiff
ESP: Fix some unreachable code warnings
authorFrancois-Xavier Le Bail <[email protected]>
Tue, 17 Jul 2018 20:10:57 +0000 (22:10 +0200)
committerFrancois-Xavier Le Bail <[email protected]>
Tue, 17 Jul 2018 20:10:57 +0000 (22:10 +0200)
Found with -Wunreachable-code-return clang compiler option.

The errors were:

./print-esp.c:317:10: warning: 'return' will never be executed
      [-Wunreachable-code-return]
                return 0;
                       ^
./print-esp.c:552:4: warning: 'return' will never be executed
      [-Wunreachable-code-return]
                        return;
                        ^~~~~~

print-esp.c

index c4d7a75d4e2a02e0eaac92fa1ffccdcd9d1aceae..774ec72ca842a365474b7ee34b3860770ace5836 100644 (file)
@@ -314,7 +314,6 @@ static u_int hexdigit(netdissect_options *ndo, char hex)
        else {
                (*ndo->ndo_error)(ndo, S_ERR_ND_ESP_SECRET,
                                  "invalid hex digit %c in espsecret\n", hex);
-               return 0;
        }
 }
 
@@ -549,7 +548,6 @@ static void esp_print_decode_onesecret(netdissect_options *ndo, char *line,
                        (*ndo->ndo_error)(ndo, S_ERR_ND_OPEN_FILE,
                                          "print_esp: can't open %s: %s\n",
                                          filename, strerror(errno));
-                       return;
                }
 
                while (fgets(fileline, sizeof(fileline)-1, secretfile) != NULL) {