aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2016-05-29 18:39:51 +0200
committerAnders Broman <a.broman58@gmail.com>2016-06-02 08:31:01 +0000
commitd1ae5bc961ef6317b5e2f891e3878102208dc38b (patch)
treef8bd736c37f0cc699c88729ae2f6faa168ab2022 /epan/tvbuff.c
parent745a6021bcee3d725b11bdaa3d0d554c4d723b6e (diff)
clean up some comments in tvb_find_line_end()
Change-Id: I9025b479b31e3cc6f8108a163bf00d81008fd737 Reviewed-on: https://code.wireshark.org/review/15632 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index 8cf6a0e8b5..0936998075 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -3050,10 +3050,10 @@ static ws_mempbrk_pattern pbrk_crlf;
* Return the length of the line (not counting the line terminator at
* the end), or, if we don't find a line terminator:
*
- * if "deseg" is true, return -1;
+ * if "desegment" is true, return -1;
*
- * if "deseg" is false, return the amount of data remaining in
- * the buffer.
+ * if "desegment" is false, return the amount of data remaining in
+ * the buffer.
*
* Set "*next_offset" to the offset of the character past the line
* terminator, or past the end of the buffer if we don't find a line
@@ -3070,12 +3070,11 @@ tvb_find_line_end(tvbuff_t *tvb, const gint offset, int len, gint *next_offset,
DISSECTOR_ASSERT(tvb && tvb->initialized);
- if (len == -1)
+ if (len == -1) {
len = _tvb_captured_length_remaining(tvb, offset);
- /*
- * XXX - what if "len" is still -1, meaning "offset is past the
- * end of the tvbuff"?
- */
+ /* if offset is past the end of the tvbuff, len is now 0 */
+ }
+
eob_offset = offset + len;
if (!compiled) {