diff options
author | Guy Harris <guy@alum.mit.edu> | 2014-04-09 01:04:37 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2014-04-09 08:05:07 +0000 |
commit | 7d83a8755a20579ec7d6b98b341ae17d8cb6bf65 (patch) | |
tree | 2ba6123af90a2a402000239de17f879b6d26a801 /epan/dissectors/packet-aim.c | |
parent | 412c6cabcfd96efeae6c13f1e918d99be002eaf8 (diff) |
Don't use tvb_get_nstringz0(), use tvb_get_string_enc().
Change-Id: I8e654fa857fca6713198e3d20f2a14a0a444e935
Reviewed-on: https://code.wireshark.org/review/1037
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/dissectors/packet-aim.c')
-rw-r--r-- | epan/dissectors/packet-aim.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/epan/dissectors/packet-aim.c b/epan/dissectors/packet-aim.c index db17e5f41f..c78f0e4dd4 100644 --- a/epan/dissectors/packet-aim.c +++ b/epan/dissectors/packet-aim.c @@ -493,16 +493,13 @@ const aim_family } int -aim_get_buddyname( guchar *name, tvbuff_t *tvb, int len_offset, int name_offset) +aim_get_buddyname( guint8 **name, tvbuff_t *tvb, int offset) { guint8 buddyname_length; - buddyname_length = tvb_get_guint8(tvb, len_offset); - - if(buddyname_length > MAX_BUDDYNAME_LENGTH ) - buddyname_length = MAX_BUDDYNAME_LENGTH; + buddyname_length = tvb_get_guint8(tvb, offset); - tvb_get_nstringz0(tvb, name_offset, buddyname_length + 1, name); + *name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, buddyname_length, ENC_UTF_8|ENC_NA); return buddyname_length; } |