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-pppoe.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-pppoe.c')
-rw-r--r-- | epan/dissectors/packet-pppoe.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-pppoe.c b/epan/dissectors/packet-pppoe.c index f13391a2ad..05081dd9e5 100644 --- a/epan/dissectors/packet-pppoe.c +++ b/epan/dissectors/packet-pppoe.c @@ -483,11 +483,13 @@ dissect_pppoe_tags(tvbuff_t *tvb, packet_info *pinfo, int offset, proto_tree *tr } break; case PPPOE_TAG_AC_NAME: - proto_tree_add_item(pppoe_tree, hf_pppoed_tag_ac_name, tvb, - tagstart+4, poe_tag_length, ENC_ASCII|ENC_NA); + { + const guint8* str; + proto_tree_add_item_ret_string(pppoe_tree, hf_pppoed_tag_ac_name, tvb, + tagstart+4, poe_tag_length, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); /* Show AC-Name in info column */ - col_append_fstr(pinfo->cinfo, COL_INFO, " AC-Name='%s'", - tvb_get_string_enc(wmem_packet_scope(), tvb, tagstart+4, poe_tag_length, ENC_ASCII|ENC_NA)); + col_append_fstr(pinfo->cinfo, COL_INFO, " AC-Name='%s'", str); + } break; case PPPOE_TAG_HOST_UNIQ: proto_tree_add_item(pppoe_tree, hf_pppoed_tag_host_uniq, tvb, |