From 00c74e34be5c224ec7b18ae763d4db381fa3e7f0 Mon Sep 17 00:00:00 2001 From: guy Date: Thu, 15 Jul 2004 00:13:01 +0000 Subject: [PATCH] "sizeof()" could be "unsigned long" or "unsigned int"; cast it to "unsigned long" and print it with "%lu", so it works in either case, regardless of whether "long" is the same size as "int" or not. --- print-tcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print-tcp.c b/print-tcp.c index c3b4d6ea..1ccebaae 100644 --- a/print-tcp.c +++ b/print-tcp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.116 2004-07-08 10:25:08 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.117 2004-07-15 00:13:01 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -266,8 +266,8 @@ tcp_print(register const u_char *bp, register u_int length, } if (hlen < sizeof(*tp)) { - (void)printf(" tcp %d [bad hdr length %u - too short, < %u]", - length - hlen, hlen, sizeof(*tp)); + (void)printf(" tcp %d [bad hdr length %u - too short, < %lu]", + length - hlen, hlen, (unsigned long)sizeof(*tp)); return; } -- 2.39.5