]> The Tcpdump Group git mirrors - tcpdump/commitdiff
RESP: Fix an invalid check
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 2 Mar 2022 20:48:43 +0000 (21:48 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 2 Mar 2022 20:49:17 +0000 (21:49 +0100)
Fix this cppcheck warning:
print-resp.c:215:22: warning: Checking if unsigned expression 'length'
is less than zero. [unsignedLessThanZero]
    if(!bp || length <= 0)
                     ^

print-resp.c

index 00a6e257d41746656825c9fe2c8ddde0b8d61cdf..c5d67be40998cafd409ce9820f7f9bfe8a717060 100644 (file)
@@ -212,7 +212,7 @@ resp_print(netdissect_options *ndo, const u_char *bp, u_int length)
     int ret_len = 0, length_cur = length;
 
     ndo->ndo_protocol = "resp";
-    if(!bp || length <= 0)
+    if(!bp || length == 0)
         return;
 
     ND_PRINT(": RESP");