tvbuff: add assertion to tvb_skip_wsp_return().

Minor indentation fixes.

Change-Id: I0b22b1b247efc4f1db535eb1f7cb7e99c3637ba0
Reviewed-on: https://code.wireshark.org/review/28981
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Dario Lombardo 2018-08-06 10:34:53 +02:00 committed by Peter Wu
parent 3d07f6f512
commit e1d144e471
1 changed files with 6 additions and 2 deletions

View File

@ -3645,14 +3645,18 @@ tvb_skip_wsp(tvbuff_t *tvb, const gint offset, const gint maxlength)
}
gint
tvb_skip_wsp_return(tvbuff_t *tvb, const gint offset) {
tvb_skip_wsp_return(tvbuff_t *tvb, const gint offset)
{
gint counter = offset;
guint8 tempchar;
for(counter = offset; counter > 0 &&
DISSECTOR_ASSERT(tvb && tvb->initialized);
for (counter = offset; counter > 0 &&
((tempchar = tvb_get_guint8(tvb,counter)) == ' ' ||
tempchar == '\t' || tempchar == '\n' || tempchar == '\r'); counter--);
counter++;
return (counter);
}