From: Francois-Xavier Le Bail Date: Wed, 2 Mar 2022 20:48:43 +0000 (+0100) Subject: RESP: Fix an invalid check X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/9fe73b290d70525e1cae59bb55087ef81baf08e8?hp=c43334b0d460eaee9de0a9186f2fb16ffe3d9ca9 RESP: Fix an invalid check Fix this cppcheck warning: print-resp.c:215:22: warning: Checking if unsigned expression 'length' is less than zero. [unsignedLessThanZero] if(!bp || length <= 0) ^ --- diff --git a/print-resp.c b/print-resp.c index 00a6e257..c5d67be4 100644 --- a/print-resp.c +++ b/print-resp.c @@ -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");