Skip to content

Commit

Permalink
Fix a bunch of "sizeof(sizeof(XXX))".
Browse files Browse the repository at this point in the history
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 <guy@alum.mit.edu>
  • Loading branch information
Sascha Wildner authored and guyharris committed Dec 7, 2011
1 parent 5d52dbf commit 684955d
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions print-eigrp.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion print-ldp.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion print-lmp.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion print-lspping.c
Expand Up @@ -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);


Expand Down
2 changes: 1 addition & 1 deletion print-rsvp.c
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions print-slow.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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));
}

Expand Down

0 comments on commit 684955d

Please sign in to comment.