diff options
author | Guy Harris <guy@alum.mit.edu> | 2006-06-16 07:17:00 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2006-06-16 07:17:00 +0000 |
commit | 753aa36dbf11dd548843cb8e9c7f22f16045b2df (patch) | |
tree | 4c91da844000219a8a515917804bdda12daf1212 /epan/dissectors/packet-componentstatus.c | |
parent | 1af7caeeb10e5fb615f46a45fbeb3878183608da (diff) |
"proto_tree_add_text()" supports printf-style formats; there's no need
to format into a buffer and then pass that buffer.
Make a count an "int" rather than a "size_t" to squelch a (valid)
compiler warning.
svn path=/trunk/; revision=18482
Diffstat (limited to 'epan/dissectors/packet-componentstatus.c')
-rw-r--r-- | epan/dissectors/packet-componentstatus.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/epan/dissectors/packet-componentstatus.c b/epan/dissectors/packet-componentstatus.c index 7a6f8c050f..460fdab7f9 100644 --- a/epan/dissectors/packet-componentstatus.c +++ b/epan/dissectors/packet-componentstatus.c @@ -158,10 +158,9 @@ dissect_componentstatusprotocol_componentstatusreport_message(tvbuff_t *message_ proto_item *association_item; proto_tree *association_tree; gint associations; - size_t i; + int i; gint offset; gint remaining_length; - char title[64]; proto_tree_add_item(message_tree, hf_componentstatusreport_reportinterval, message_tvb, COMPONENTSTATUSREPORT_REPORTINTERVAL_OFFSET, COMPONENTSTATUSREPORT_REPORTINTERVAL_LENGTH, FALSE); proto_tree_add_item(message_tree, hf_componentstatusreport_location, message_tvb, COMPONENTSTATUSREPORT_LOCATION_OFFSET, COMPONENTSTATUSREPORT_LOCATION_LENGTH, FALSE); @@ -173,8 +172,8 @@ dissect_componentstatusprotocol_componentstatusreport_message(tvbuff_t *message_ offset = COMPONENTSTATUSREPORT_ASSOCIATIONARRAY_OFFSET; i = 1; while((remaining_length = tvb_length_remaining(message_tvb, offset)) >= COMPONENTASSOCIATION_LENGTH) { - snprintf((char*)&title, sizeof(title), "Association #%d", i++); - association_item = proto_tree_add_text(message_tree, message_tvb, offset, COMPONENTASSOCIATION_LENGTH, title); + association_item = proto_tree_add_text(message_tree, message_tvb, offset, COMPONENTASSOCIATION_LENGTH, + "Association #%d", i++); association_tree = proto_item_add_subtree(association_item, ett_association); association_tvb = tvb_new_subset(message_tvb, offset, COMPONENTASSOCIATION_LENGTH, COMPONENTASSOCIATION_LENGTH); |