diff options
author | Michael Mann <mmann78@netscape.net> | 2014-08-03 21:10:24 -0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-08-05 07:36:26 +0000 |
commit | 9d5f9141af289d3d8b253907eaaae101da1bd9fd (patch) | |
tree | 4d2816511482c04e3e8af66bd6251f5f7ce2dc2f /epan/dissectors/packet-daap.c | |
parent | edbb9edf3928e79b41f9b84d2399205810febef2 (diff) |
Eliminate proto_tree_add_text from some dissectors.
Other minor cleanup while in the area.
Change-Id: Id8d957d3d68a2e3dd5089f490bd59d773e1be967
Reviewed-on: https://code.wireshark.org/review/3427
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-daap.c')
-rw-r--r-- | epan/dissectors/packet-daap.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/epan/dissectors/packet-daap.c b/epan/dissectors/packet-daap.c index f449ee9d8d..47d979480d 100644 --- a/epan/dissectors/packet-daap.c +++ b/epan/dissectors/packet-daap.c @@ -441,15 +441,15 @@ dissect_daap_one_tag(proto_tree *tree, tvbuff_t *tvb) while ((offset >= 0) && (offset < reported_length)) { tagname = tvb_get_ntohl(tvb, offset); tagsize = tvb_get_ntohl(tvb, offset+4); - ti = proto_tree_add_text(tree, tvb, offset, 8, + new_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_daap_sub, &ti, "Tag: %-40s %3u byte%c", val_to_str_ext(tagname, &vals_tag_code_ext, "Unknown tag (0x%0x)"), tagsize, plurality(tagsize, ' ', 's')); - ti2 = proto_tree_add_item(tree, hf_daap_name, tvb, offset, 4, ENC_ASCII|ENC_NA); + ti2 = proto_tree_add_item(new_tree, hf_daap_name, tvb, offset, 4, ENC_ASCII|ENC_NA); PROTO_ITEM_SET_HIDDEN(ti2); - ti2 = proto_tree_add_item(tree, hf_daap_size, tvb, offset+4, 4, ENC_BIG_ENDIAN); + ti2 = proto_tree_add_item(new_tree, hf_daap_size, tvb, offset+4, 4, ENC_BIG_ENDIAN); PROTO_ITEM_SET_HIDDEN(ti2); offset += 8; @@ -459,10 +459,10 @@ dissect_daap_one_tag(proto_tree *tree, tvbuff_t *tvb) if (tagsize <= (unsigned)len) { len = tagsize; } - proto_item_set_len(ti, 8+len); /* *Now* it's Ok to set the length. */ - /* (Done here so that the proto_tree_add_text */ - /* above will show tag and tagsize even if */ - /* tagsize is very large). */ + proto_item_set_len(ti, 8+len); /* *Now* it's Ok to set the length. */ + /* (Done here so that the proto_tree_add_subtree */ + /* above will show tag and tagsize even if */ + /* tagsize is very large). */ switch (tagname) { case daap_mcon: case daap_msrv: @@ -490,7 +490,6 @@ dissect_daap_one_tag(proto_tree *tree, tvbuff_t *tvb) case dacp_cmgt: case dacp_cmst: /* Container tags */ - new_tree = proto_item_add_subtree(ti, ett_daap_sub); new_tvb = tvb_new_subset_length(tvb, offset, len); /* Use a new tvb so bounds checking */ /* works Ok when dissecting container. */ /* Note: len is within tvb; checked above. */ |