From 488e0a6db4b03b46eeffc5240bd3c67f1204496c Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Fri, 1 Jan 2021 22:12:44 -0800 Subject: [PATCH] Use %zu when printing a sizeof. We require a C implementation that supports %z, so we can use it; there is no guarantee that a sizeof is a long, so don't use %l. Squelches warnings found on Solaris 11 with GCC. --- print-olsr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print-olsr.c b/print-olsr.c index eca30142..991c8771 100644 --- a/print-olsr.c +++ b/print-olsr.c @@ -323,7 +323,7 @@ olsr_print(netdissect_options *ndo, tptr = pptr; if (length < sizeof(struct olsr_common)) { - ND_PRINT(" (packet length < %lu)", sizeof(struct olsr_common)); + ND_PRINT(" (packet length < %zu)", sizeof(struct olsr_common)); goto invalid; } @@ -419,7 +419,7 @@ olsr_print(netdissect_options *ndo, case OLSR_HELLO_MSG: case OLSR_HELLO_LQ_MSG: if (msg_tlen < sizeof(struct olsr_hello)) { - ND_PRINT(" (message length < %lu)", sizeof(struct olsr_hello)); + ND_PRINT(" (message length < %zu)", sizeof(struct olsr_hello)); goto invalid; } @@ -481,7 +481,7 @@ olsr_print(netdissect_options *ndo, case OLSR_TC_LQ_MSG: if (msg_tlen < sizeof(struct olsr_tc)) { goto invalid; - ND_PRINT(" (message length < %lu)", sizeof(struct olsr_tc)); + ND_PRINT(" (message length < %zu)", sizeof(struct olsr_tc)); } ND_TCHECK_LEN(msg_data, sizeof(struct olsr_tc));