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-dcerpc-epm.c | |
parent | 8c37621ca733a24a972e3e069a537c06e650f435 (diff) | |
download | wireshark-2ab415579491e4bc66ea58627bda504cae833b9e.tar.gz |
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-dcerpc-epm.c')
-rw-r--r-- | epan/dissectors/packet-dcerpc-epm.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/epan/dissectors/packet-dcerpc-epm.c b/epan/dissectors/packet-dcerpc-epm.c index efa83ae0ae..6789b51a17 100644 --- a/epan/dissectors/packet-dcerpc-epm.c +++ b/epan/dissectors/packet-dcerpc-epm.c @@ -157,7 +157,7 @@ epm_dissect_ept_entry_t(tvbuff_t *tvb, int offset, proto_tree *tree=NULL; int old_offset=offset; guint32 len; - const char *str; + const guint8 *str; if(di->conformant_run){ return offset; @@ -178,8 +178,7 @@ epm_dissect_ept_entry_t(tvbuff_t *tvb, int offset, hf_epm_ann_offset, NULL); offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep, hf_epm_ann_len, &len); - str=tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII); - proto_tree_add_item(tree, hf_epm_annotation, tvb, offset, len, ENC_ASCII|ENC_NA); + proto_tree_add_item_ret_string(tree, hf_epm_annotation, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); offset += len; if(str&&str[0]){ @@ -315,6 +314,7 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset, guint16 num_floors, ii; const char *uuid_name; guint8 u8little_endian = DREP_LITTLE_ENDIAN; + const guint8 *str; if(di->conformant_run){ return offset; @@ -425,18 +425,18 @@ epm_dissect_tower_data (tvbuff_t *tvb, int offset, break; case PROTO_ID_NAMED_PIPES: /* \\PIPE\xxx named pipe */ - proto_tree_add_item(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA); - proto_item_append_text(tr, "NamedPipe:%s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII)); + proto_tree_add_item_ret_string(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_item_append_text(tr, "NamedPipe:%s", str); break; case PROTO_ID_NAMED_PIPES_2: /* PIPENAME named pipe */ - proto_tree_add_item(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA); - proto_item_append_text(tr, "PIPE:%s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII)); + proto_tree_add_item_ret_string(tr, hf_epm_proto_named_pipes, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_item_append_text(tr, "PIPE:%s", str); break; case PROTO_ID_NETBIOS: /* \\NETBIOS netbios name */ - proto_tree_add_item(tr, hf_epm_proto_netbios_name, tvb, offset, len, ENC_ASCII|ENC_NA); - proto_item_append_text(tr, "NetBIOS:%s", tvb_get_string_enc(wmem_packet_scope(), tvb, offset, len, ENC_ASCII)); + proto_tree_add_item_ret_string(tr, hf_epm_proto_netbios_name, tvb, offset, len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &str); + proto_item_append_text(tr, "NetBIOS:%s", str); break; case PROTO_ID_HTTP: /* RPC over HTTP */ proto_tree_add_item(tr, hf_epm_proto_http_port, tvb, offset, 2, ENC_BIG_ENDIAN); |