aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dcerpc-spoolss.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2013-12-16 22:39:41 +0000
committerGuy Harris <guy@alum.mit.edu>2013-12-16 22:39:41 +0000
commit068008f04f9c31a47197564b1de2f6f2ddd9b3ab (patch)
tree626069aac3c295f0612e774fd09ccee255d19397 /epan/dissectors/packet-dcerpc-spoolss.c
parent54c272466f362a169421c9d8f7571c4c0459d117 (diff)
Use proto_tree_add_item() in preference to fetching the string and
adding it with proto_tree_add_string(). Use tvb_get_string_enc() rather than tvb_get_unicode_string() to fetch strings. We assume a UTF-16 encoding for all "Unicode" strings. Use tvb_strsize() and tvb_unicode_strsize() to get the lengths of null-terminated strings. Get rid of unused ett_nt_unicode_string variable. svn path=/trunk/; revision=54158
Diffstat (limited to 'epan/dissectors/packet-dcerpc-spoolss.c')
-rw-r--r--epan/dissectors/packet-dcerpc-spoolss.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/epan/dissectors/packet-dcerpc-spoolss.c b/epan/dissectors/packet-dcerpc-spoolss.c
index f6ecc377c8..5792e38942 100644
--- a/epan/dissectors/packet-dcerpc-spoolss.c
+++ b/epan/dissectors/packet-dcerpc-spoolss.c
@@ -498,7 +498,7 @@ dissect_spoolss_string_parm_data(tvbuff_t *tvb, int offset, packet_info *pinfo,
offset = dissect_ndr_uint32(tvb, offset, pinfo, tree, di, drep,
hf_string_parm_size, &buffer_len);
- s = tvb_get_unicode_stringz(wmem_packet_scope(), tvb, offset, &len, ENC_LITTLE_ENDIAN);
+ s = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_UTF_16|ENC_LITTLE_ENDIAN);
if (tree && buffer_len) {
tvb_ensure_bytes_exist(tvb, offset, buffer_len);
@@ -694,7 +694,7 @@ dissect_printerdata_data(tvbuff_t *tvb, int offset,
switch(type) {
case DCERPC_REG_SZ: {
- char *data = tvb_get_unicode_string(NULL, tvb, offset - size, size, ENC_LITTLE_ENDIAN);
+ char *data = tvb_get_string_enc(NULL, tvb, offset - size, size, ENC_UTF_16|ENC_LITTLE_ENDIAN);
proto_item_append_text(item, ": %s", data);
@@ -1083,7 +1083,7 @@ dissect_spoolss_uint16uni(tvbuff_t *tvb, int offset, packet_info *pinfo _U_,
return offset;
}
- text = tvb_get_unicode_string(NULL, tvb, offset, remaining, ENC_LITTLE_ENDIAN);
+ text = tvb_get_string_enc(NULL, tvb, offset, remaining, ENC_UTF_16|ENC_LITTLE_ENDIAN);
len = (int)strlen(text);
proto_tree_add_text(tree, tvb, offset, len * 2, "%s: %s",
@@ -5838,8 +5838,8 @@ cb_notify_str_postprocess(packet_info *pinfo _U_,
len = tvb_get_letohl(tvb, start_offset);
- s = tvb_get_unicode_string(NULL,
- tvb, start_offset + 4, (end_offset - start_offset - 4), ENC_LITTLE_ENDIAN);
+ s = tvb_get_string_enc(NULL,
+ tvb, start_offset + 4, (end_offset - start_offset - 4), ENC_UTF_16|ENC_LITTLE_ENDIAN);
/* Append string to upper-level proto_items */