"compute_offset_length()" must, if it returns FALSE, and "exception" is

non-null, set "*exception" to the appropriate exception - its callers
rely on it.

Now that it does that, there's no need for "check_offset_length()" to
check for a length of -1, as "compute_offset_length()" does so, and
therefore "check_offset_length_no_exception()" does so.

svn path=/trunk/; revision=8562
This commit is contained in:
Guy Harris 2003-09-28 21:39:53 +00:00
parent 82d0ca7c51
commit b530c88a3b
1 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@
* the data of a backing tvbuff, or can be a composite of
* other tvbuffs.
*
* $Id: tvbuff.c,v 1.50 2003/09/10 21:19:47 gerald Exp $
* $Id: tvbuff.c,v 1.51 2003/09/28 21:39:53 guy Exp $
*
* Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu>
*
@ -408,6 +408,10 @@ compute_offset_length(tvbuff_t *tvb, gint offset, gint length,
/* Compute the length */
if (length < -1) {
if (exception) {
/* XXX - ReportedBoundsError? */
*exception = BoundsError;
}
return FALSE;
}
else if (length == -1) {
@ -481,10 +485,6 @@ check_offset_length(tvbuff_t *tvb, gint offset, gint length,
{
int exception = 0;
if (length < -1) {
THROW(BoundsError);
}
if (!check_offset_length_no_exception(tvb, offset, length, offset_ptr, length_ptr, &exception)) {
g_assert(exception > 0);
THROW(exception);