]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix a bunch of "sizeof(sizeof(XXX))".
authorSascha Wildner <[email protected]>
Wed, 7 Dec 2011 18:42:12 +0000 (10:42 -0800)
committerGuy Harris <[email protected]>
Wed, 7 Dec 2011 18:42:12 +0000 (10:42 -0800)
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 <[email protected]>
print-eigrp.c
print-ldp.c
print-lmp.c
print-lspping.c
print-rsvp.c
print-slow.c

index 2787bafb9d2606c0f0596dc5b8c844561a604f88..4f941d96629e8517fc0825c6755afa58715082f2 100644 (file)
@@ -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;
index de3b34e5b54f94d264863f8286a1956ccd85901b..1243104855b7414faaca60c2623b21695192199e 100644 (file)
@@ -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;
index 556db173e49bd33e2a9603185ef754a8de25379c..e09b89fc22ed22f5602d0739b6138dd0b8048a42 100644 (file)
@@ -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;
index 6958bdac7e73fe9114e9e03b884bf3a9514637f4..2ca57fb05cf9dd48bfb243ae9a144b61f4bfa81c 100644 (file)
@@ -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);
 
 
index 6aa2f6d71bd6eeeb8eb3690084f0157edf3b75df..1c76dcbbf6a9ac85f05236581c8356947a5da807 100644 (file)
@@ -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;
index eaf94ed9bbbccdc92d7cf2eb608eb5358eb0337c..fdfefccf386a00c9596fe49bcff67bbbde121525 100644 (file)
@@ -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));
         }