From ebd65e6e3456f4bae91da7138778af054e653be8 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 30 Jul 2009 23:45:14 +0000 Subject: [PATCH] added an assert test --- src/cas/generic/inBuf.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cas/generic/inBuf.cc b/src/cas/generic/inBuf.cc index b9e9a50db..88d47f907 100644 --- a/src/cas/generic/inBuf.cc +++ b/src/cas/generic/inBuf.cc @@ -51,12 +51,12 @@ inBuf::~inBuf () // // inBuf::show() // -void inBuf::show (unsigned level) const +void inBuf :: show (unsigned level) const { if ( level > 1u ) { printf ( "\tUnprocessed request bytes = %d\n", - this->bytesAvailable()); + this->bytesPresent () ); } } @@ -73,8 +73,9 @@ inBufClient::fillCondition inBuf::fill ( inBufClient::fillParameter parm ) // move back any prexisting data to the start of the buffer // if ( this->nextReadIndex > 0 ) { - bufSizeT unprocessedBytes; - unprocessedBytes = this->bytesInBuffer - this->nextReadIndex; + assert ( this->bytesInBuffer >= this->nextReadIndex ); + bufSizeT unprocessedBytes = + this->bytesInBuffer - this->nextReadIndex; // // memmove() handles overlapping buffers //