From fc63343a4ebebeb594a162c57bd1b17315a6e4d5 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 5 Jul 2014 15:25:32 -0400 Subject: convert to proto_tree_add_subtree[_format] Change-Id: I8df48b25de784a48a25f0e48aac1e1545ed92c35 Reviewed-on: https://code.wireshark.org/review/2865 Reviewed-by: Michael Mann --- epan/dissectors/packet-osi-options.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'epan/dissectors/packet-osi-options.c') diff --git a/epan/dissectors/packet-osi-options.c b/epan/dissectors/packet-osi-options.c index 71f091debb..86a4792f7d 100644 --- a/epan/dissectors/packet-osi-options.c +++ b/epan/dissectors/packet-osi-options.c @@ -404,8 +404,7 @@ dissect_option_atn_security_label(const guchar sub_type, guchar length, tvbuff_t *tvb, guint offset, proto_tree *tree) { - proto_item *ti; - proto_tree *atn_sl_tree = NULL; + proto_tree *atn_sl_tree; guchar len = 0; guint8 tag_name = 0; guint security_info_end = 0; @@ -423,10 +422,9 @@ dissect_option_atn_security_label(const guchar sub_type, guchar length, if ( tvb_memeql(tvb, ++offset , atn_security_registration_val, OSI_OPT_SECURITY_ATN_SR_LEN) ) return; - ti = proto_tree_add_text(tree, tvb, offset, length, "%s", + atn_sl_tree = proto_tree_add_subtree(tree, tvb, offset, length, ott_osi_qos, NULL, val_to_str(sub_type, osi_opt_sec_atn_sr_vals, "Unknown (0x%x)")); - atn_sl_tree = proto_item_add_subtree(ti, ott_osi_qos); offset += OSI_OPT_SECURITY_ATN_SR_LEN; /* Security Information length */ @@ -519,9 +517,8 @@ dissect_osi_options(guchar opt_len, tvbuff_t *tvb, int offset, proto_tree *tree) return; } - ti = proto_tree_add_text(tree, tvb, offset, opt_len, - "### Option Section ###"); - osi_option_tree = proto_item_add_subtree(ti, ott_osi_options); + osi_option_tree = proto_tree_add_subtree(tree, tvb, offset, opt_len, + ott_osi_options, &ti, "### Option Section ###"); while ( 0 < opt_len ) { parm_type = tvb_get_guint8(tvb, offset++); -- cgit v1.2.3