From: Francois-Xavier Le Bail Date: Wed, 4 Nov 2020 13:52:20 +0000 (+0100) Subject: LDP: Use %zu to print sizeof values X-Git-Tag: tcpdump-4.99-bp~68 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/1a9542cfd1f59a329e8cb32fb1737e7c8a11ecd2 LDP: Use %zu to print sizeof values Moreover: Fix indentation. --- diff --git a/print-ldp.c b/print-ldp.c index 75e6dd20..896bc403 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -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; }