summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ieee80211.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2017-01-29 21:53:49 -0500
committerMichael Mann <mmann78@netscape.net>2017-01-31 02:26:35 +0000
commitd802b5b0ec8e10fbf64f6c76815b759323029bb4 (patch)
tree2071ff718141347ff02c8dc02aafb9090e8fc5e1 /epan/dissectors/packet-ieee80211.c
parent60a877167f05644a5a75676798084027accd1c3d (diff)
downloadwireshark-d802b5b0ec8e10fbf64f6c76815b759323029bb4.tar.gz
Add format_text_wmem.
This allows for a wmem_allocator for users of format_text who want it (dissectors for wmem_packet_scope()). This lessens the role of current format_text functionality in hopes that it will eventually be replaced. Change-Id: I970557a65e32aa79634a3fcc654ab641b871178e Reviewed-on: https://code.wireshark.org/review/19855 Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ieee80211.c')
-rw-r--r--epan/dissectors/packet-ieee80211.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ieee80211.c b/epan/dissectors/packet-ieee80211.c
index a0b8ee1a0d..91c441350f 100644
--- a/epan/dissectors/packet-ieee80211.c
+++ b/epan/dissectors/packet-ieee80211.c
@@ -11406,7 +11406,7 @@ dissect_ssid_list(proto_tree *tree, tvbuff_t *tvb, int offset, guint32 tag_len)
if (offset + 2 + len > end)
break;
- str = format_text(tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 2, len, ENC_ASCII), len);
+ str = tvb_format_text(tvb, offset + 2, len);
proto_item_append_text(tree, "%c %s", (first ? ':' : ','), str);
first = FALSE;
entry = proto_tree_add_subtree_format(tree, tvb, offset, 2 + len, ett_ssid_list, NULL, "SSID: %s", str);
@@ -13470,9 +13470,10 @@ ieee80211_tag_ssid(packet_info *pinfo, proto_tree *tree,
ENC_ASCII|ENC_NA);
if (ssid_len > 0) {
- proto_item_append_text(ti, ": %s", format_text(ssid, ssid_len));
+ gchar* s = format_text_wmem(wmem_packet_scope(), ssid, ssid_len);
+ proto_item_append_text(ti, ": %s", s);
- col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", format_text(ssid, ssid_len));
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", SSID=%s", s);
/* Wlan Stats */
memcpy(wlan_stats.ssid, ssid, MIN(ssid_len, MAX_SSID_LEN));
@@ -15509,8 +15510,9 @@ add_tagged_field(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset
proto_tree_add_item_ret_string(tree, hf_ieee80211_mesh_id, tvb, offset, tag_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &mesh_id);
if (tag_len > 0) {
- col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", format_text(mesh_id, tag_len));
- proto_item_append_text(ti, ": %s", format_text(mesh_id, tag_len));
+ gchar* s = format_text_wmem(wmem_packet_scope(), mesh_id, tag_len);
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", MESHID=%s", s);
+ proto_item_append_text(ti, ": %s", s);
}
break;