diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-12-16 22:39:41 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-12-16 22:39:41 +0000 |
commit | 068008f04f9c31a47197564b1de2f6f2ddd9b3ab (patch) | |
tree | 626069aac3c295f0612e774fd09ccee255d19397 /epan/dissectors/packet-smb.c | |
parent | 54c272466f362a169421c9d8f7571c4c0459d117 (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-smb.c')
-rw-r--r-- | epan/dissectors/packet-smb.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/epan/dissectors/packet-smb.c b/epan/dissectors/packet-smb.c index cd3344488c..c29789740d 100644 --- a/epan/dissectors/packet-smb.c +++ b/epan/dissectors/packet-smb.c @@ -11111,10 +11111,7 @@ dissect_transaction2_request_parameters(tvbuff_t *tvb, packet_info *pinfo, COUNT_BYTES_TRANS(4); /* file name */ - if (si->unicode) - fn = tvb_get_unicode_stringz(wmem_packet_scope(), tvb, offset, &fn_len, ENC_LITTLE_ENDIAN); - else - fn = tvb_get_stringz(wmem_packet_scope(), tvb, offset, &fn_len); + fn = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &fn_len, (si->unicode ? ENC_UTF_16|ENC_LITTLE_ENDIAN : ENC_ASCII|ENC_NA)); CHECK_STRING_TRANS(fn); proto_tree_add_string(tree, hf_smb_file_name, tvb, offset, fn_len, |