README.dissector: update info about tvb_get_nstringz

Update invalid description for tvb_get_nstringz() and
tvb_get_nstringz0().

Change-Id: I03483bc1a2aa5a701b44cd895b91289716ef215d
Reviewed-on: https://code.wireshark.org/review/26598
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Tadeusz Struk 2018-03-23 09:07:20 -07:00 committed by Anders Broman
parent a00bb067d7
commit fbf1409719
1 changed files with 9 additions and 5 deletions

View File

@ -360,11 +360,15 @@ sequences.
gint tvb_get_nstringz(tvbuff_t *tvb, const gint offset, const guint bufsize, guint8* buffer);
gint tvb_get_nstringz0(tvbuff_t *tvb, const gint offset, const guint bufsize, guint8* buffer);
Returns a null-terminated buffer containing data from the specified tvbuff,
starting at the specified offset, and containing all characters from the
tvbuff up to and including a terminating null character in the tvbuff.
"*lengthp" will be set to the length of the string, including the terminating
null.
Copies bufsize bytes, including the terminating NULL, to buffer. If a NULL
terminator is found before reaching bufsize, only the bytes up to and including
the NULL are copied. Returns the number of bytes copied (not including
terminating NULL), or -1 if the string was truncated in the buffer due to
not having reached the terminating NULL. In this case, the resulting
buffer is not NULL-terminated.
tvb_get_nstringz0() works like tvb_get_nstringz(), but never returns -1 since
the string is guaranteed to have a terminating NULL. If the string was truncated
when copied into buffer, a NULL is placed at the end of buffer to terminate it.
gchar *tvb_get_ts_23_038_7bits_string(wmem_allocator_t *scope,
tvbuff_t *tvb, const gint bit_offset, gint no_of_chars);