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 /plugins | |
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 'plugins')
-rw-r--r-- | plugins/unistim/packet-unistim.c | 3 | ||||
-rw-r--r-- | plugins/unistim/packet-unistim.h | 32 |
2 files changed, 17 insertions, 18 deletions
diff --git a/plugins/unistim/packet-unistim.c b/plugins/unistim/packet-unistim.c index c5f867136c..de74ec2837 100644 --- a/plugins/unistim/packet-unistim.c +++ b/plugins/unistim/packet-unistim.c @@ -1048,8 +1048,7 @@ dissect_display_switch(proto_tree *msg_tree, } if(msg_len>0){ /* I'm guessing this will work flakily at best */ - uinfo->string_data = tvb_get_string_enc(wmem_packet_scope(), tvb,offset,msg_len,ENC_ASCII); - proto_tree_add_string(msg_tree,hf_generic_string,tvb,offset,msg_len,uinfo->string_data); + proto_tree_add_item_ret_string(msg_tree,hf_generic_string,tvb,offset,msg_len, ENC_ASCII|ENC_NA, wmem_packet_scope(), &uinfo->string_data); } offset+=msg_len; diff --git a/plugins/unistim/packet-unistim.h b/plugins/unistim/packet-unistim.h index 20c72d35b7..7093bb0125 100644 --- a/plugins/unistim/packet-unistim.h +++ b/plugins/unistim/packet-unistim.h @@ -27,22 +27,22 @@ typedef struct _unistim_info_t { - guint8 rudp_type; /* NAK, ACK, Payload */ - guint8 payload_type; /* unistim payload type (aggregate, non-aggregate, encapsulated) */ - guint32 sequence; /* rudp sequence number */ - guint32 termid; /* termid if available */ - address it_ip; /* IP addr of it, determined by who is sending termids */ - guint32 it_port; /* port of it (phone) */ - address ni_ip; /* IP addr of ni (server) as determined by who's sending termids */ - gint key_val; /* actual key pressed (-1 if not used) */ - gint key_state; /* Key state 1=down 0=up */ - gint hook_state; /* Hook state 1=offhook 0=onhook */ - gint stream_connect; /* Audio stream connect 1=connect 0=disconnect */ - gint trans_connect; /* Transducer connect? 1=connect 0=disconnect */ - gint set_termid; /* Set the termid 1=set termid */ - guint8 *string_data; /* Any time a string is written to the display, this has the string */ - gint call_state; /* Not used? */ - guchar *key_buffer; /* Used in voip-calls.c tap, holds call keys pressed */ + guint8 rudp_type; /* NAK, ACK, Payload */ + guint8 payload_type; /* unistim payload type (aggregate, non-aggregate, encapsulated) */ + guint32 sequence; /* rudp sequence number */ + guint32 termid; /* termid if available */ + address it_ip; /* IP addr of it, determined by who is sending termids */ + guint32 it_port; /* port of it (phone) */ + address ni_ip; /* IP addr of ni (server) as determined by who's sending termids */ + gint key_val; /* actual key pressed (-1 if not used) */ + gint key_state; /* Key state 1=down 0=up */ + gint hook_state; /* Hook state 1=offhook 0=onhook */ + gint stream_connect; /* Audio stream connect 1=connect 0=disconnect */ + gint trans_connect; /* Transducer connect? 1=connect 0=disconnect */ + gint set_termid; /* Set the termid 1=set termid */ + const guint8 *string_data; /* Any time a string is written to the display, this has the string */ + gint call_state; /* Not used? */ + guchar *key_buffer; /* Used in voip-calls.c tap, holds call keys pressed */ } unistim_info_t; #endif |