]> The Tcpdump Group git mirrors - tcpdump/commitdiff
"sizeof()" could be "unsigned long" or "unsigned int"; cast it to
authorguy <guy>
Thu, 15 Jul 2004 00:13:01 +0000 (00:13 +0000)
committerguy <guy>
Thu, 15 Jul 2004 00:13:01 +0000 (00:13 +0000)
"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 c3b4d6ea66d931d942fb8da68de4ff5e88401382..1ccebaae004bfa9bc59c1f850bd92628b1ad7953 100644 (file)
@@ -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;
        }