invalid circular buffer overflow

This commit is contained in:
David Rose 2001-10-23 02:49:48 +00:00
parent 210349cda8
commit 2a78a849ef
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ template<class Thing, int max_size>
INLINE int CircBuffer<Thing, max_size>::
size() const {
int diff = _in - _out;
return (diff >= 0) ? diff : max_size + 1 - diff;
return (diff >= 0) ? diff : max_size + 1 + diff;
}
////////////////////////////////////////////////////////////////////