]> The Tcpdump Group git mirrors - tcpdump/commitdiff
TCP: Fix an invalid check
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 2 Mar 2022 16:46:27 +0000 (17:46 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 2 Mar 2022 16:47:18 +0000 (17:47 +0100)
Fix this cppcheck warning:
print-tcp.c:711:20: warning: Checking if unsigned expression 'length'
is less than zero. [unsignedLessThanZero]
        if (length <= 0)
                   ^

print-tcp.c

index 86b70511e63d2ee1808b507f5032b1db06f2d638..d9ca4a34b940c1a2d6058dde91fcedb28e752265 100644 (file)
@@ -708,7 +708,7 @@ tcp_print(netdissect_options *ndo,
          */
         ND_PRINT(", length %u", length);
 
-        if (length <= 0)
+        if (length == 0)
                 return;
 
         /*