summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-icep.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2016-06-26 10:52:37 -0400
committerPascal Quantin <pascal.quantin@gmail.com>2016-06-27 15:20:06 +0000
commit2ab415579491e4bc66ea58627bda504cae833b9e (patch)
tree0f7f8eaa4bd9d90c8f6066036522ef0fc65d137d /epan/dissectors/packet-icep.c
parent8c37621ca733a24a972e3e069a537c06e650f435 (diff)
downloadwireshark-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-icep.c')
-rw-r--r--epan/dissectors/packet-icep.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/epan/dissectors/packet-icep.c b/epan/dissectors/packet-icep.c
index d45806f4fe..5bb16fe117 100644
--- a/epan/dissectors/packet-icep.c
+++ b/epan/dissectors/packet-icep.c
@@ -170,7 +170,7 @@ static const value_string icep_mode_vals[] = {
* "*dest" is a null terminated version of the dissected Ice string.
*/
static void dissect_ice_string(packet_info *pinfo, proto_tree *tree, proto_item *item, int hf_icep,
- tvbuff_t *tvb, guint32 offset, gint32 *consumed, char **dest)
+ tvbuff_t *tvb, guint32 offset, gint32 *consumed, const guint8 **dest)
{
/* p. 586 chapter 23.2.1 and p. 588 chapter 23.2.5
* string == Size + content
@@ -180,7 +180,7 @@ static void dissect_ice_string(packet_info *pinfo, proto_tree *tree, proto_item
*/
guint32 Size = 0;
- char *s = NULL;
+ const guint8 *s = NULL;
(*consumed) = 0;
@@ -240,8 +240,7 @@ static void dissect_ice_string(packet_info *pinfo, proto_tree *tree, proto_item
if ( Size != 0 ) {
- s = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, Size, ENC_ASCII);
- proto_tree_add_string(tree, hf_icep, tvb, offset, Size, s);
+ proto_tree_add_item_ret_string(tree, hf_icep, tvb, offset, Size, ENC_ASCII, wmem_packet_scope(), &s);
} else {
s = wmem_strdup(wmem_packet_scope(), "(empty)");
/* display the 0x00 Size byte when click on a empty ice_string */
@@ -412,10 +411,10 @@ static void dissect_ice_context(packet_info *pinfo, proto_tree *tree, proto_item
for ( i = 0; i < Size; i++ ) {
/* key */
gint32 consumed_key = 0;
- char *str_key = NULL;
+ const guint8 *str_key = NULL;
/* value */
gint32 consumed_value = 0;
- char *str_value = NULL;
+ const guint8 *str_value = NULL;
proto_item *ti;
proto_tree *context_tree;
@@ -555,8 +554,8 @@ static void dissect_icep_request_common(tvbuff_t *tvb, guint32 offset,
*/
gint32 consumed = 0;
- char *namestr = NULL;
- char *opstr = NULL;
+ const guint8 *namestr = NULL;
+ const guint8 *opstr = NULL;
(*total_consumed) = 0;