diff options
-rw-r--r-- | epan/tvbuff.c | 6 | ||||
-rw-r--r-- | epan/tvbuff.h | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index 85953b3013..0e2888d248 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -427,7 +427,7 @@ tvb_length_remaining(const tvbuff_t *tvb, const gint offset) exception = compute_offset_and_remaining(tvb, offset, &abs_offset, &rem_length); if (exception) - return -1; + return 0; return rem_length; } @@ -545,12 +545,12 @@ tvb_reported_length_remaining(const tvbuff_t *tvb, const gint offset) exception = compute_offset(tvb, offset, &abs_offset); if (exception) - return -1; + return 0; if (tvb->reported_length >= abs_offset) return tvb->reported_length - abs_offset; else - return -1; + return 0; } /* Set the reported length of a tvbuff to a given value; used for protocols diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 0646fcef38..7fef12da6b 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -221,8 +221,8 @@ WS_DLL_PUBLIC void tvb_composite_finalize(tvbuff_t* tvb); WS_DLL_PUBLIC guint tvb_length(const tvbuff_t*); /** Computes bytes to end of buffer, from offset (which can be negative, - * to indicate bytes from end of buffer). Function returns -1 to - * indicate that offset is out of bounds. No exception is thrown. */ + * to indicate bytes from end of buffer). Function returns 0 if offset is out + * of bounds. No exception is thrown. */ WS_DLL_PUBLIC gint tvb_length_remaining(const tvbuff_t*, const gint offset); /** Same as above, but throws an exception if the offset is out of bounds. */ @@ -244,8 +244,7 @@ WS_DLL_PUBLIC guint tvb_reported_length(const tvbuff_t*); /** Computes bytes of reported packet data to end of buffer, from offset * (which can be negative, to indicate bytes from end of buffer). Function - * returns -1 to indicate that offset is out of bounds. No exception is - * thrown. */ + * returns 0 if offset is out of bounds. No exception is thrown. */ WS_DLL_PUBLIC gint tvb_reported_length_remaining(const tvbuff_t *tvb, const gint offset); /** Set the reported length of a tvbuff to a given value; used for protocols |