From: guy Date: Wed, 13 Sep 2006 06:31:11 +0000 (+0000) Subject: Cast "sizeof" to a "u_int"; it's not guaranteed to be "int" in size (it X-Git-Tag: tcpdump-4.0.0~198 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/d7da1619b5f30dc84f0303ce025a8df04b8a42f8 Cast "sizeof" to a "u_int"; it's not guaranteed to be "int" in size (it could be "long", for example, and probably *is* "long" on LP64 platforms), so you can't print it with "%u", but, in this particular case, it's going to fit in a 32-bit quantity. --- diff --git a/print-ospf6.c b/print-ospf6.c index 2a9b97f1..11004856 100644 --- a/print-ospf6.c +++ b/print-ospf6.c @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.14 2006-09-05 15:50:26 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ospf6.c,v 1.15 2006-09-13 06:31:11 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -150,7 +150,7 @@ ospf6_print_lshdr(register const struct lsa6_hdr *lshp) ipaddr_string(&lshp->ls_router), EXTRACT_32BITS(&lshp->ls_seq), EXTRACT_16BITS(&lshp->ls_age), - EXTRACT_16BITS(&lshp->ls_length)-sizeof(struct lsa6_hdr)); + EXTRACT_16BITS(&lshp->ls_length)-(u_int)sizeof(struct lsa6_hdr)); ospf6_print_ls_type(EXTRACT_16BITS(&lshp->ls_type), &lshp->ls_stateid);