]> The Tcpdump Group git mirrors - tcpdump/commitdiff
More use of %zu to print sizeof values.
authorGuy Harris <[email protected]>
Sun, 11 Aug 2019 19:23:36 +0000 (12:23 -0700)
committerGuy Harris <[email protected]>
Sun, 11 Aug 2019 19:23:36 +0000 (12:23 -0700)
print-cfm.c
print-isoclns.c
print-ospf.c
print-rsvp.c
print-slow.c
print-tcp.c

index 971c960039f8b6d3b4e980d0fd6c9b1fef6b76b8..63d58e39b6c1d7bf2eabab0386c14782f2c12518 100644 (file)
@@ -341,8 +341,8 @@ cfm_print(netdissect_options *ndo,
     case CFM_OPCODE_CCM:
         msg_ptr.cfm_ccm = (const struct cfm_ccm_t *)tptr;
         if (first_tlv_offset < sizeof(*msg_ptr.cfm_ccm)) {
-            ND_PRINT(" (too small 1, must be >= %lu)",
-                     (unsigned long) sizeof(*msg_ptr.cfm_ccm));
+            ND_PRINT(" (too small 1, must be >= %zu)",
+                     sizeof(*msg_ptr.cfm_ccm));
             return;
         }
         if (tlen < sizeof(*msg_ptr.cfm_ccm))
@@ -471,8 +471,8 @@ cfm_print(netdissect_options *ndo,
     case CFM_OPCODE_LTM:
         msg_ptr.cfm_ltm = (const struct cfm_ltm_t *)tptr;
         if (first_tlv_offset < sizeof(*msg_ptr.cfm_ltm)) {
-            ND_PRINT(" (too small 4, must be >= %lu)",
-                     (unsigned long) sizeof(*msg_ptr.cfm_ltm));
+            ND_PRINT(" (too small 4, must be >= %zu)",
+                     sizeof(*msg_ptr.cfm_ltm));
             return;
         }
         if (tlen < sizeof(*msg_ptr.cfm_ltm))
@@ -494,8 +494,8 @@ cfm_print(netdissect_options *ndo,
     case CFM_OPCODE_LTR:
         msg_ptr.cfm_ltr = (const struct cfm_ltr_t *)tptr;
         if (first_tlv_offset < sizeof(*msg_ptr.cfm_ltr)) {
-            ND_PRINT(" (too small 5, must be >= %lu)",
-                     (unsigned long) sizeof(*msg_ptr.cfm_ltr));
+            ND_PRINT(" (too small 5, must be >= %zu)",
+                     sizeof(*msg_ptr.cfm_ltr));
             return;
         }
         if (tlen < sizeof(*msg_ptr.cfm_ltr))
index 6bbe75c39ed219bc0dcc94f3d37e9dccd28b2318..176279c15daf643534f9813cec152c08e3900f86 100644 (file)
@@ -1763,9 +1763,9 @@ isis_print_tlv_ip_reach(netdissect_options *ndo,
 
        while (length > 0) {
                if ((size_t)length < sizeof(*tlv_ip_reach)) {
-                       ND_PRINT("short IPv4 Reachability (%u vs %lu)",
+                       ND_PRINT("short IPv4 Reachability (%u vs %zu)",
                                length,
-                               (unsigned long)sizeof(*tlv_ip_reach));
+                               sizeof(*tlv_ip_reach));
                        return (0);
                }
 
@@ -2435,8 +2435,8 @@ isis_print(netdissect_options *ndo,
     case ISIS_PDU_L1_LAN_IIH:
     case ISIS_PDU_L2_LAN_IIH:
         if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE)) {
-            ND_PRINT(", bogus fixed header length %u should be %lu",
-                     fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE));
+            ND_PRINT(", bogus fixed header length %u should be %zu",
+                     fixed_len, ISIS_COMMON_HEADER_SIZE+ISIS_IIH_LAN_HEADER_SIZE);
             return (0);
         }
         ND_TCHECK_SIZE(header_iih_lan);
@@ -2480,8 +2480,8 @@ isis_print(netdissect_options *ndo,
 
     case ISIS_PDU_PTP_IIH:
         if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE)) {
-            ND_PRINT(", bogus fixed header length %u should be %lu",
-                      fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE));
+            ND_PRINT(", bogus fixed header length %u should be %zu",
+                      fixed_len, ISIS_COMMON_HEADER_SIZE+ISIS_IIH_PTP_HEADER_SIZE);
             return (0);
         }
         ND_TCHECK_SIZE(header_iih_ptp);
@@ -2521,8 +2521,8 @@ isis_print(netdissect_options *ndo,
     case ISIS_PDU_L1_LSP:
     case ISIS_PDU_L2_LSP:
         if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_LSP_HEADER_SIZE)) {
-            ND_PRINT(", bogus fixed header length %u should be %lu",
-                   fixed_len, (unsigned long)ISIS_LSP_HEADER_SIZE);
+            ND_PRINT(", bogus fixed header length %u should be %zu",
+                   fixed_len, ISIS_LSP_HEADER_SIZE);
             return (0);
         }
         ND_TCHECK_SIZE(header_lsp);
@@ -2579,8 +2579,8 @@ isis_print(netdissect_options *ndo,
     case ISIS_PDU_L1_CSNP:
     case ISIS_PDU_L2_CSNP:
         if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE)) {
-            ND_PRINT(", bogus fixed header length %u should be %lu",
-                      fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE));
+            ND_PRINT(", bogus fixed header length %u should be %zu",
+                      fixed_len, ISIS_COMMON_HEADER_SIZE+ISIS_CSNP_HEADER_SIZE);
             return (0);
         }
         ND_TCHECK_SIZE(header_csnp);
@@ -2617,8 +2617,8 @@ isis_print(netdissect_options *ndo,
     case ISIS_PDU_L1_PSNP:
     case ISIS_PDU_L2_PSNP:
         if (fixed_len != (ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE)) {
-            ND_PRINT("- bogus fixed header length %u should be %lu",
-                   fixed_len, (unsigned long)(ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE));
+            ND_PRINT("- bogus fixed header length %u should be %zu",
+                   fixed_len, ISIS_COMMON_HEADER_SIZE+ISIS_PSNP_HEADER_SIZE);
             return (0);
         }
         ND_TCHECK_SIZE(header_psnp);
index eeb7c40dac69f2a9d3bd4a90a0774677c66d978e..c7491617de0fb36cd309901aba80a8aadb0b4838 100644 (file)
@@ -517,8 +517,8 @@ ospf_print_lshdr(netdissect_options *ndo,
         ND_TCHECK_2(lshp->ls_length);
         ls_length = GET_BE_U_2(lshp->ls_length);
         if (ls_length < sizeof(struct lsa_hdr)) {
-                ND_PRINT("\n\t    Bogus length %u < header (%lu)", ls_length,
-                    (unsigned long)sizeof(struct lsa_hdr));
+                ND_PRINT("\n\t    Bogus length %u < header (%zu)", ls_length,
+                    sizeof(struct lsa_hdr));
                 return(-1);
         }
 
index 17dd7358da97fe9137377ec0c960bfaca955cb06..c1efc1ded76a3c7d5279ba5f9e595e639dbf1e09 100644 (file)
@@ -698,8 +698,8 @@ rsvp_obj_print(netdissect_options *ndo,
             return -1;
         }
         if(rsvp_obj_len < sizeof(struct rsvp_object_header)) {
-            ND_PRINT("%sERROR: object header too short %u < %lu", indent, rsvp_obj_len,
-                   (unsigned long)sizeof(struct rsvp_object_header));
+            ND_PRINT("%sERROR: object header too short %u < %zu", indent, rsvp_obj_len,
+                   sizeof(struct rsvp_object_header));
             return -1;
         }
 
@@ -1921,8 +1921,8 @@ rsvp_print(netdissect_options *ndo,
            GET_BE_U_2(rsvp_com_header->checksum));
 
     if (tlen < sizeof(struct rsvp_common_header)) {
-        ND_PRINT("ERROR: common header too short %u < %lu", tlen,
-               (unsigned long)sizeof(struct rsvp_common_header));
+        ND_PRINT("ERROR: common header too short %u < %zu", tlen,
+               sizeof(struct rsvp_common_header));
         return;
     }
 
@@ -1969,8 +1969,8 @@ rsvp_print(netdissect_options *ndo,
                    GET_BE_U_2(rsvp_com_header->checksum));
 
             if (subtlen < sizeof(struct rsvp_common_header)) {
-                ND_PRINT("ERROR: common header too short %u < %lu", subtlen,
-                       (unsigned long)sizeof(struct rsvp_common_header));
+                ND_PRINT("ERROR: common header too short %u < %zu", subtlen,
+                       sizeof(struct rsvp_common_header));
                 return;
             }
 
index dc364cecfeb7d476bdfcb41fb60275e6a7d1e5f9..1eb4c96ab907910ae77ceffcd64dffec55dba619 100644 (file)
@@ -388,8 +388,8 @@ slow_marker_lacp_print(netdissect_options *ndo,
 
         /* length includes the type and length fields */
         if (tlv_len < sizeof(struct tlv_header_t)) {
-            ND_PRINT("\n\t    ERROR: illegal length - should be >= %lu",
-                   (unsigned long) sizeof(struct tlv_header_t));
+            ND_PRINT("\n\t    ERROR: illegal length - should be >= %zu",
+                   sizeof(struct tlv_header_t));
             return;
         }
 
@@ -409,8 +409,8 @@ slow_marker_lacp_print(netdissect_options *ndo,
         case ((SLOW_PROTO_LACP << 8) + LACP_TLV_PARTNER_INFO):
             if (tlv_tlen !=
                 sizeof(struct lacp_tlv_actor_partner_info_t)) {
-                ND_PRINT("\n\t    ERROR: illegal length - should be %lu",
-                       (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_actor_partner_info_t)));
+                ND_PRINT("\n\t    ERROR: illegal length - should be %zu",
+                       sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_actor_partner_info_t));
                 goto badlength;
             }
 
@@ -432,8 +432,8 @@ slow_marker_lacp_print(netdissect_options *ndo,
         case ((SLOW_PROTO_LACP << 8) + LACP_TLV_COLLECTOR_INFO):
             if (tlv_tlen !=
                 sizeof(struct lacp_tlv_collector_info_t)) {
-                ND_PRINT("\n\t    ERROR: illegal length - should be %lu",
-                       (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_collector_info_t)));
+                ND_PRINT("\n\t    ERROR: illegal length - should be %zu",
+                       sizeof(struct tlv_header_t) + sizeof(struct lacp_tlv_collector_info_t));
                 goto badlength;
             }
 
@@ -447,8 +447,8 @@ slow_marker_lacp_print(netdissect_options *ndo,
         case ((SLOW_PROTO_MARKER << 8) + MARKER_TLV_MARKER_INFO):
             if (tlv_tlen !=
                 sizeof(struct marker_tlv_marker_info_t)) {
-                ND_PRINT("\n\t    ERROR: illegal length - should be %lu",
-                       (unsigned long) (sizeof(struct tlv_header_t) + sizeof(struct marker_tlv_marker_info_t)));
+                ND_PRINT("\n\t    ERROR: illegal length - should be %zu",
+                       sizeof(struct tlv_header_t) + sizeof(struct marker_tlv_marker_info_t));
                 goto badlength;
             }
 
@@ -575,8 +575,8 @@ slow_oam_print(netdissect_options *ndo,
 
                 if (GET_U_1(tlv.slow_oam_info->info_length) !=
                     sizeof(struct slow_oam_info_t)) {
-                    ND_PRINT("\n\t    ERROR: illegal length - should be %lu",
-                           (unsigned long) sizeof(struct slow_oam_info_t));
+                    ND_PRINT("\n\t    ERROR: illegal length - should be %zu",
+                           sizeof(struct slow_oam_info_t));
                     hexdump = TRUE;
                     goto badlength_code_info;
                 }
@@ -676,8 +676,8 @@ slow_oam_print(netdissect_options *ndo,
 
                 if (GET_U_1(tlv.slow_oam_link_event->event_length) !=
                     sizeof(struct slow_oam_link_event_t)) {
-                    ND_PRINT("\n\t    ERROR: illegal length - should be %lu",
-                           (unsigned long) sizeof(struct slow_oam_link_event_t));
+                    ND_PRINT("\n\t    ERROR: illegal length - should be %zu",
+                           sizeof(struct slow_oam_link_event_t));
                     hexdump = TRUE;
                     goto badlength_event_notif;
                 }
index d5c5f6d6f5ddebc9534f8996acabb4f3fcc24267..3310b9e9b2aafcbb071bc5070418c9d154af47a3 100644 (file)
@@ -227,8 +227,8 @@ tcp_print(netdissect_options *ndo,
         hlen = TH_OFF(tp) * 4;
 
         if (hlen < sizeof(*tp)) {
-                ND_PRINT(" tcp %u [bad hdr length %u - too short, < %lu]",
-                         length - hlen, hlen, (unsigned long)sizeof(*tp));
+                ND_PRINT(" tcp %u [bad hdr length %u - too short, < %zu]",
+                         length - hlen, hlen, sizeof(*tp));
                 return;
         }