diff options
author | Dario Lombardo <lomato@gmail.com> | 2014-06-17 17:30:58 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-06-18 14:13:58 +0000 |
commit | 971ffd683ea23362bd8009567ff7860371e6e2cc (patch) | |
tree | 28c9ada98d2e59b196fc839d39ab2448fd436968 /epan/dissectors/packet-wsp.c | |
parent | 421d817d70737ebd459b7027274bf38bb2d9a2ff (diff) |
Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-wsp.c')
-rw-r--r-- | epan/dissectors/packet-wsp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-wsp.c b/epan/dissectors/packet-wsp.c index ad8492bcba..2c2fef9107 100644 --- a/epan/dissectors/packet-wsp.c +++ b/epan/dissectors/packet-wsp.c @@ -1287,7 +1287,7 @@ static void add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *p * get_text_string() macro now returns wmem_alloc'd memory. */ #define get_text_string(str,tvb,start,len,ok) \ if (is_text_string(tvb_get_guint8(tvb,start))) { \ - str = (gchar *)tvb_get_stringz(wmem_packet_scope(), tvb,start,(gint *)&len); \ + str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb,start,(gint *)&len,ENC_ASCII); \ ok = TRUE; \ } else { len = 0; str = NULL; ok = FALSE; } #define get_token_text(str,tvb,start,len,ok) \ @@ -1786,13 +1786,13 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo) tvb, offset, 2, codepage); offset += 2; } else if (hdr_id >= 0x20) { /* Textual header */ - /* Header name MUST be NUL-ended string ==> tvb_get_stringz() */ - hdr_str = (gchar *)tvb_get_stringz(wmem_packet_scope(), tvb, hdr_start, (gint *)&hdr_len); + /* Header name MUST be NUL-ended string ==> tvb_get_stringz_enc() */ + hdr_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, hdr_start, (gint *)&hdr_len, ENC_ASCII); val_start = hdr_start + hdr_len; val_id = tvb_get_guint8(tvb, val_start); /* Call header value dissector for given header */ if (val_id >= 0x20 && val_id <=0x7E) { /* OK! */ - val_str = (gchar *)tvb_get_stringz(wmem_packet_scope(), tvb, val_start, (gint *)&val_len); + val_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, val_start, (gint *)&val_len, ENC_ASCII); offset = val_start + val_len; tvb_ensure_bytes_exist(tvb, hdr_start, offset-hdr_start); proto_tree_add_text(wsp_headers,tvb,hdr_start,offset-hdr_start, @@ -1916,7 +1916,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo) #define wkh_2_TextualValue /* Parse Textual Value */ \ /* END */ \ } else if ((val_id == 0) || (val_id >= 0x20)) { /* Textual value */ \ - val_str = (gchar *)tvb_get_stringz (wmem_packet_scope(), tvb, val_start, (gint *)&val_len); \ + val_str = (gchar *)tvb_get_stringz_enc(wmem_packet_scope(), tvb, val_start, (gint *)&val_len, ENC_ASCII); \ offset = val_start + val_len; \ /* Textual value processing starts HERE \ * \ @@ -1925,7 +1925,7 @@ add_headers (proto_tree *tree, tvbuff_t *tvb, int hf, packet_info *pinfo) #define wkh_2_TextualValueInv /* Parse Textual Value */ \ /* END */ \ } else if ((val_id == 0) || (val_id >= 0x20)) { /* Textual value */ \ - /*val_str = (gchar *)*/tvb_get_stringz (wmem_packet_scope(), tvb, val_start, (gint *)&val_len); \ + /*val_str = (gchar *)*/tvb_get_stringz_enc(wmem_packet_scope(), tvb, val_start, (gint *)&val_len, ENC_ASCII); \ offset = val_start + val_len; \ /* Textual value processing starts HERE \ * \ @@ -5815,7 +5815,7 @@ add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint v char *variableBuffer; char *valueBuffer; - variableBuffer = tvb_get_string(wmem_packet_scope(), tvb, variableStart, variableLength); + variableBuffer = tvb_get_string_enc(wmem_packet_scope(), tvb, variableStart, variableLength, ENC_ASCII); if (valueEnd < valueStart) { @@ -5828,7 +5828,7 @@ add_post_variable (proto_tree *tree, tvbuff_t *tvb, guint variableStart, guint v valueLength = valueEnd-valueStart; /* XXX - if this throws an exception, "variableBuffer" is leaked */ - valueBuffer = tvb_get_string(wmem_packet_scope(), tvb, valueStart, valueLength); + valueBuffer = tvb_get_string_enc(wmem_packet_scope(), tvb, valueStart, valueLength, ENC_ASCII); } /* Check for variables with no value */ |