From: Sascha Wildner Date: Wed, 7 Dec 2011 18:42:12 +0000 (-0800) Subject: Fix a bunch of "sizeof(sizeof(XXX))". X-Git-Tag: tcpdump-4.3.0~44 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/684955d58611ee94eccdc34e82b32e676337188c Fix a bunch of "sizeof(sizeof(XXX))". In some places, there was one too many levels of sizeof() - sizeof(sizeof(XXX)) is sizeof(size_t), but we wanted the size of type XXX. Reviewed-By: Guy Harris --- diff --git a/print-eigrp.c b/print-eigrp.c index 2787bafb..4f941d96 100644 --- a/print-eigrp.c +++ b/print-eigrp.c @@ -280,7 +280,7 @@ eigrp_print(register const u_char *pptr, register u_int len) { if (eigrp_tlv_len < sizeof(struct eigrp_tlv_header) || eigrp_tlv_len > tlen) { - print_unknown_data(tptr+sizeof(sizeof(struct eigrp_tlv_header)),"\n\t ",tlen); + print_unknown_data(tptr+sizeof(struct eigrp_tlv_header),"\n\t ",tlen); return; } @@ -468,7 +468,7 @@ eigrp_print(register const u_char *pptr, register u_int len) { } /* do we want to see an additionally hexdump ? */ if (vflag > 1) - print_unknown_data(tptr+sizeof(sizeof(struct eigrp_tlv_header)),"\n\t ", + print_unknown_data(tptr+sizeof(struct eigrp_tlv_header),"\n\t ", eigrp_tlv_len-sizeof(struct eigrp_tlv_header)); tptr+=eigrp_tlv_len; diff --git a/print-ldp.c b/print-ldp.c index de3b34e5..12431048 100644 --- a/print-ldp.c +++ b/print-ldp.c @@ -609,7 +609,7 @@ ldp_msg_print(register const u_char *pptr) { } /* do we want to see an additionally hexdump ? */ if (vflag > 1 || hexdump==TRUE) - print_unknown_data(tptr+sizeof(sizeof(struct ldp_msg_header)),"\n\t ", + print_unknown_data(tptr+sizeof(struct ldp_msg_header),"\n\t ", msg_len); tptr += msg_len+4; diff --git a/print-lmp.c b/print-lmp.c index 556db173..e09b89fc 100644 --- a/print-lmp.c +++ b/print-lmp.c @@ -871,7 +871,7 @@ lmp_print(register const u_char *pptr, register u_int len) { } /* do we want to see an additionally hexdump ? */ if (vflag > 1 || hexdump==TRUE) - print_unknown_data(tptr+sizeof(sizeof(struct lmp_object_header)),"\n\t ", + print_unknown_data(tptr+sizeof(struct lmp_object_header),"\n\t ", lmp_obj_len-sizeof(struct lmp_object_header)); tptr+=lmp_obj_len; diff --git a/print-lspping.c b/print-lspping.c index 6958bdac..2ca57fb0 100644 --- a/print-lspping.c +++ b/print-lspping.c @@ -878,7 +878,7 @@ lspping_print(register const u_char *pptr, register u_int len) { } /* do we want to see an additionally tlv hexdump ? */ if (vflag > 1 || tlv_hexdump==TRUE) - print_unknown_data(tptr+sizeof(sizeof(struct lspping_tlv_header)),"\n\t ", + print_unknown_data(tptr+sizeof(struct lspping_tlv_header),"\n\t ", lspping_tlv_len); diff --git a/print-rsvp.c b/print-rsvp.c index 6aa2f6d7..1c76dcbb 100644 --- a/print-rsvp.c +++ b/print-rsvp.c @@ -1790,7 +1790,7 @@ _U_ } /* do we also want to see a hex dump ? */ if (vflag > 1 || hexdump==TRUE) - print_unknown_data(tptr+sizeof(sizeof(struct rsvp_object_header)),"\n\t ", /* FIXME indentation */ + print_unknown_data(tptr+sizeof(struct rsvp_object_header),"\n\t ", /* FIXME indentation */ rsvp_obj_len-sizeof(struct rsvp_object_header)); tptr+=rsvp_obj_len; diff --git a/print-slow.c b/print-slow.c index eaf94ed9..fdfefccf 100644 --- a/print-slow.c +++ b/print-slow.c @@ -368,7 +368,7 @@ void slow_marker_lacp_print(register const u_char *tptr, register u_int tlen) { tlv_header->type != LACP_TLV_TERMINATOR && tlv_header->type != MARKER_TLV_TERMINATOR) { printf("\n\t-----trailing data-----"); - print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ",tlen); + print_unknown_data(tptr+sizeof(struct tlv_header_t),"\n\t ",tlen); return; } @@ -441,7 +441,7 @@ void slow_marker_lacp_print(register const u_char *tptr, register u_int tlen) { } /* do we want to see an additional hexdump ? */ if (vflag > 1) { - print_unknown_data(tptr+sizeof(sizeof(struct tlv_header_t)),"\n\t ", + print_unknown_data(tptr+sizeof(struct tlv_header_t),"\n\t ", tlv_len-sizeof(struct tlv_header_t)); }