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/asn1/c1222 | |
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/asn1/c1222')
-rw-r--r-- | epan/dissectors/asn1/c1222/packet-c1222-template.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/epan/dissectors/asn1/c1222/packet-c1222-template.c b/epan/dissectors/asn1/c1222/packet-c1222-template.c index c10244893e..c01a342ea0 100644 --- a/epan/dissectors/asn1/c1222/packet-c1222-template.c +++ b/epan/dissectors/asn1/c1222/packet-c1222-template.c @@ -374,8 +374,8 @@ static void parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cmd, guint32 *length, int *offset) { guint16 user_id = 0; - guint8 *user_name = NULL; - guint8 *password = NULL; + const guint8 *user_name = NULL; + const guint8 *password = NULL; guint8 auth_len = 0; gchar *auth_req = NULL; guint16 table = 0; @@ -408,8 +408,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm user_id = tvb_get_ntohs(tvb, *offset); proto_tree_add_uint(tree, hf_c1222_logon_id, tvb, *offset, 2, user_id); *offset += 2; - user_name = tvb_get_string_enc(wmem_packet_scope(),tvb, *offset, 10, ENC_ASCII); - proto_tree_add_string(tree, hf_c1222_logon_user, tvb, *offset, 10, user_name); + proto_tree_add_item_ret_string(tree, hf_c1222_logon_user, tvb, *offset, 10, ENC_ASCII|ENC_NA, wmem_packet_scope(), &user_name); *offset += 10; *length -= 12; proto_item_set_text(tree, "C12.22 EPSEM: %s (id %d, user \"%s\")", @@ -420,8 +419,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm break; case C1222_CMD_SECURITY: if (*length >= 20) { - password = tvb_get_string_enc(wmem_packet_scope(),tvb, *offset, 20, ENC_ASCII); - proto_tree_add_string(tree, hf_c1222_security_password, tvb, *offset, 20, password); + proto_tree_add_item_ret_string(tree, hf_c1222_security_password, tvb, *offset, 20, ENC_ASCII|ENC_NA, wmem_packet_scope(), &password); *offset += 20; *length -= 20; if (*length >= 2) { |