invalid circular buffer overflow
This commit is contained in:
parent
210349cda8
commit
2a78a849ef
|
|
@ -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;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
Loading…
Reference in New Issue