Find the line ending using tvb_find_line_end().
authorGuy Harris <guy@alum.mit.edu>
Thu, 26 Dec 2019 10:55:27 +0000 (02:55 -0800)
committerGuy Harris <guy@alum.mit.edu>
Thu, 26 Dec 2019 18:08:27 +0000 (18:08 +0000)
commita81c8e57bfb3596c552d49cf66fa695e0391406d
tree0ca896b9a7e56f3538367f5f2577016aaf00ef13
parentf0be7f27d862a5f460b398693fe4731e7ed87aa8
Find the line ending using tvb_find_line_end().

tvb_find_line_end(), unlike a tvb_find_guint8() looking for an LF,
returns a length that *doesn't* include the line ending, *regardless* of
whether the line ends with CR-LF or just LF, so the query string we
extract is just the query, without any of the line ending.

Update some comments while we're at it to note that the "next_offset"
pointer argument to tvb_find_line_end() and tvb_find_line_end_unquoted()
can be NULL, in which case the offset *past* the line ending isn't
returned.  (We pass tvb_find_line_end() NULL in the aforementioned call,
because, in that particular case, we don't care about the next line.)

Change-Id: I1c9746e32c61a79f8cb636d577a2e14a07ecab17
Reviewed-on: https://code.wireshark.org/review/35566
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
epan/dissectors/packet-whois.c
epan/tvbuff.c
epan/tvbuff.h