]> The Tcpdump Group git mirrors - tcpdump/commitdiff
OSPF: Replace '> 0' with '!= 0' in an unsigned expression test
authorFrancois-Xavier Le Bail <[email protected]>
Mon, 26 Feb 2024 09:30:57 +0000 (10:30 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Mon, 26 Feb 2024 12:39:44 +0000 (13:39 +0100)
Unsigned is always >= 0, so '> 0' and '!= 0' are identical.

This makes the test a little clearer.

Moreover:
Remove some extra blank lines.

print-ospf.c

index 18eeab9694adf72fa288112ccf4a865d5443cc56..3b4637c13d1de4cb4e13ea20c7be81b2d1de776a 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "ospf.h"
 
-
 static const struct tok ospf_option_values[] = {
        { OSPF_OPTION_MT,       "MultiTopology" }, /* draft-ietf-ospf-mt-09 */
        { OSPF_OPTION_E,        "External" },
@@ -131,7 +130,6 @@ static const struct tok ep_range_tlv_prefix_sid_subtlv_flag_values[] = {
        { 0,                    NULL}
 };
 
-
 static const struct tok lsa_opaque_ep_route_type_values[] = {
        { 0, "Unspecified" },
        { 1, "Intra-Area" },
@@ -239,7 +237,6 @@ ospf_grace_lsa_print(netdissect_options *ndo,
 {
     u_int tlv_type, tlv_length;
 
-
     while (ls_length != 0) {
         ND_TCHECK_4(tptr);
         if (ls_length < 4) {
@@ -483,7 +480,7 @@ ospf_te_tlv_link_print(netdissect_options *ndo,
             count_srlg = subtlv_length / 4;
             if (count_srlg != 0)
                 ND_PRINT("\n\t\t  Shared risk group: ");
-            while (count_srlg > 0) {
+            while (count_srlg != 0) {
                 ND_PRINT("%u", GET_BE_U_4(tptr));
                 tptr+=4;
                 count_srlg--;