diff options
author | Michael Mann <mmann78@netscape.net> | 2016-06-26 10:52:37 -0400 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2016-06-27 15:20:06 +0000 |
commit | 2ab415579491e4bc66ea58627bda504cae833b9e (patch) | |
tree | 0f7f8eaa4bd9d90c8f6066036522ef0fc65d137d /epan/dissectors/packet-dcp-etsi.c | |
parent | 8c37621ca733a24a972e3e069a537c06e650f435 (diff) |
tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_string
Also some other tricks to remove unnecessary tvb_get_string_enc calls.
Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914
Reviewed-on: https://code.wireshark.org/review/16158
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-dcp-etsi.c')
-rw-r--r-- | epan/dissectors/packet-dcp-etsi.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/dissectors/packet-dcp-etsi.c b/epan/dissectors/packet-dcp-etsi.c index 7a97b0d76b..35acba77a7 100644 --- a/epan/dissectors/packet-dcp-etsi.c +++ b/epan/dissectors/packet-dcp-etsi.c @@ -153,7 +153,8 @@ static gboolean dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_) { guint8 *sync; - proto_tree *dcp_tree = NULL; + proto_tree *dcp_tree; + proto_item *ti; guint16 word; /* 6.1 AF packet structure @@ -196,11 +197,8 @@ dissect_dcp_etsi (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * col_set_str (pinfo->cinfo, COL_PROTOCOL, "DCP (ETSI)"); /*col_append_fstr (pinfo->cinfo, COL_INFO, " tvb %d", tvb_length(tvb));*/ - if(tree) { - proto_item *ti = NULL; - ti = proto_tree_add_item (tree, proto_dcp_etsi, tvb, 0, -1, ENC_NA); - dcp_tree = proto_item_add_subtree (ti, ett_edcp); - } + ti = proto_tree_add_item (tree, proto_dcp_etsi, tvb, 0, -1, ENC_NA); + dcp_tree = proto_item_add_subtree (ti, ett_edcp); sync = tvb_get_string_enc(wmem_packet_scope(), tvb, 0, 2, ENC_ASCII); dissector_try_string(dcp_dissector_table, (char*)sync, tvb, pinfo, dcp_tree, NULL); |