diff options
author | Tadeusz Struk <tadeusz.struk@intel.com> | 2018-03-23 09:07:20 -0700 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-03-25 18:59:02 +0000 |
commit | fbf1409719238051bc94d9251466f9ef5a06432b (patch) | |
tree | 2137022d2bf34ac067e9909172a94fce7a282d75 /doc/README.dissector | |
parent | a00bb067d7978d8240d4046b06daa92328e5bfb9 (diff) |
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>
Diffstat (limited to 'doc/README.dissector')
-rw-r--r-- | doc/README.dissector | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/doc/README.dissector b/doc/README.dissector index bc4a41338f..e2aa2e10fc 100644 --- a/doc/README.dissector +++ b/doc/README.dissector @@ -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); |