summaryrefslogtreecommitdiff
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-05-14 00:49:05 +0000
committerGuy Harris <guy@alum.mit.edu>2012-05-14 00:49:05 +0000
commit14b616c35d40cce1ee05592f15e548183f1fb235 (patch)
tree917e02f5b08e86246f2b18c717a6818ab430d77d /epan/tvbuff.c
parent723b213c8909521bba4d0492b2110545898a9378 (diff)
downloadwireshark-14b616c35d40cce1ee05592f15e548183f1fb235.tar.gz
Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls. Add new "add_packet_field" method to the TreeItem class, taking a protocol field (*not* a protocol), TvbRange, and encoding value as arguments. Add the ENC_ values to init.lua. Make them all hex #defines so make-init-lua.pl can easily extract them. Export tvb_unicode_strsize() for use by Lua (and elsewhere as desired). Note that it handles UTF-16 and UTF-8, and fix the comment to note that its count of hexadectets *does* include the null terminator (that's what the code does). svn path=/trunk/; revision=42621
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 921dc13dda..5857b9e8fb 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -2019,8 +2019,8 @@ tvb_strsize(tvbuff_t *tvb, const gint offset)
return (nul_offset - abs_offset) + 1;
}
-/* Unicode (UTF-16) version of tvb_strsize */
-/* Returns number of *UTF-16 characters* (not bytes) excluding the null terminator */
+/* UTF-16/UCS-2 version of tvb_strsize */
+/* Returns number of *16-bit units* (not bytes) including the null terminator */
guint
tvb_unicode_strsize(tvbuff_t *tvb, const gint offset)
{
@@ -2035,7 +2035,7 @@ tvb_unicode_strsize(tvbuff_t *tvb, const gint offset)
i += 2;
} while(uchar != 0);
- return i; /* Number of *UTF-16* characters */
+ return i; /* Number of *16-bit units* */
}
/* Find length of string by looking for end of string ('\0'), up to