From: guy Date: Wed, 28 Jul 2004 20:11:31 +0000 (+0000) Subject: Propagate from the main branch X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/350b3a06b454ed52c65929e57cde20597accd4a6 Propagate from the main branch revision 1.117 date: 2004/07/15 00:13:01; author: guy; state: Exp; lines: +3 -3 "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. --- diff --git a/print-tcp.c b/print-tcp.c index 82a714d3..9a965ff4 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.107.2.4 2004-07-08 10:29:40 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-tcp.c,v 1.107.2.5 2004-07-28 20:11:31 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -259,8 +259,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; }