]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Propagate from the main branch
authorguy <guy>
Wed, 28 Jul 2004 20:11:31 +0000 (20:11 +0000)
committerguy <guy>
Wed, 28 Jul 2004 20:11:31 +0000 (20:11 +0000)
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.

print-tcp.c

index 82a714d311da1c3bab9cc6137ab0b5169b67717d..9a965ff43646da90edde7cc050dc59e318161365 100644 (file)
@@ -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;
        }