]> The Tcpdump Group git mirrors - tcpdump/commitdiff
BGP: Replace '> 0' with '!= 0' in an unsigned expression test
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 26 Feb 2024 14:14:03 +0000 (15:14 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 26 Feb 2024 14:14:26 +0000 (15:14 +0100)
Unsigned is always >= 0, so '> 0' and '!= 0' are identical.

This makes the test a little clearer.

print-bgp.c

index 571f4388c0e7484bc58d36427930cb8ea76b0df8..9cfdf9948c1ea43ae6d19441458ea6a9188c2f24 100644 (file)
@@ -2653,7 +2653,7 @@ bgp_attr_print(netdissect_options *ndo,
         tptr += 3;
         sblen -= 3;
         /* Parse signature segments */
-        while (sblen > 0) {
+        while (sblen != 0) {
             uint16_t siglen;
 
             ND_PRINT("\n\t      Signature Segment:\n\t        SKI: ");