]> The Tcpdump Group git mirrors - tcpdump/commitdiff
LDP: Use %zu to print sizeof values
authorFrancois-Xavier Le Bail <[email protected]>
Wed, 4 Nov 2020 13:52:20 +0000 (14:52 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Wed, 4 Nov 2020 15:28:32 +0000 (16:28 +0100)
Moreover:
Fix indentation.

print-ldp.c

index 75e6dd2094ab4ee6a172b17c6f10ccbadadaa283..896bc40395fa0225e6b27d005b77202f0f2d5c0a 100644 (file)
@@ -593,10 +593,10 @@ ldp_pdu_print(netdissect_options *ndo,
     pdu_len = GET_BE_U_2(ldp_com_header->pdu_length);
     if (pdu_len < sizeof(struct ldp_common_header)-4) {
         /* length too short */
-        ND_PRINT("%sLDP, pdu-length: %u (too short, < %u)",
-               (ndo->ndo_vflag < 1) ? "" : "\n\t",
-               pdu_len,
-               (u_int)(sizeof(struct ldp_common_header)-4));
+        ND_PRINT("%sLDP, pdu-length: %u (too short, < %zu)",
+                 (ndo->ndo_vflag < 1) ? "" : "\n\t",
+                 pdu_len,
+                 sizeof(struct ldp_common_header)-4);
         return 0;
     }
 
@@ -626,13 +626,13 @@ ldp_pdu_print(netdissect_options *ndo,
         if (msg_len < sizeof(struct ldp_msg_header)-4) {
             /* length too short */
             /* FIXME vendor private / experimental check */
-            ND_PRINT("\n\t  %s Message (0x%04x), length: %u (too short, < %u)",
-                   tok2str(ldp_msg_values,
-                           "Unknown",
-                           msg_type),
-                   msg_type,
-                   msg_len,
-                   (u_int)(sizeof(struct ldp_msg_header)-4));
+            ND_PRINT("\n\t  %s Message (0x%04x), length: %u (too short, < %zu)",
+                     tok2str(ldp_msg_values,
+                             "Unknown",
+                             msg_type),
+                     msg_type,
+                     msg_len,
+                     sizeof(struct ldp_msg_header)-4);
             return 0;
         }