tvbuff: fix compilation with gcc-4.

../epan/tvbuff.c: In function 'tvb_new_octet_aligned':
../epan/tvbuff.c:274:26: error: 'abs_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   *rem_len = tvb->length - *offset_ptr;
                          ^
../epan/tvbuff.c:486:8: note: 'abs_offset' was declared here
  guint abs_offset, rem_length;
        ^
../epan/tvbuff.c: In function 'tvb_find_line_end':
../epan/tvbuff.c:274:26: error: 'abs_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   *rem_len = tvb->length - *offset_ptr;
                          ^
../epan/tvbuff.c:486:8: note: 'abs_offset' was declared here
  guint abs_offset, rem_length;
        ^
../epan/tvbuff.c: In function 'tvb_find_line_end_unquoted':
../epan/tvbuff.c:274:26: error: 'abs_offset' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   *rem_len = tvb->length - *offset_ptr;
                          ^
../epan/tvbuff.c:486:8: note: 'abs_offset' was declared here
  guint abs_offset, rem_length;

Change-Id: Iba9fe31ac5fcf604d65bbf3bceef0c09004c1b6c
Reviewed-on: https://code.wireshark.org/review/27050
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Dario Lombardo 2018-04-20 11:01:16 +02:00 committed by Anders Broman
parent 89ff4070c0
commit 1a9f3b8f6d
1 changed files with 1 additions and 1 deletions

View File

@ -483,7 +483,7 @@ tvb_captured_length(const tvbuff_t *tvb)
static inline gint
_tvb_captured_length_remaining(const tvbuff_t *tvb, const gint offset)
{
guint abs_offset, rem_length;
guint abs_offset = 0, rem_length;
int exception;
exception = compute_offset_and_remaining(tvb, offset, &abs_offset, &rem_length);