Mercurial > hg > libxtract
changeset 237:dee3b3f352ed
Fix bug in ringbuf
author | Jamie Bullock <jamie@jamiebullock.com> |
---|---|
date | Thu, 05 Jun 2014 20:24:44 +0100 |
parents | 2e293a76139b |
children | 7ebeac9b0d92 |
files | src/c-ringbuf/ringbuf.c |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/c-ringbuf/ringbuf.c Thu Jun 05 20:24:19 2014 +0100 +++ b/src/c-ringbuf/ringbuf.c Thu Jun 05 20:24:44 2014 +0100 @@ -284,9 +284,12 @@ if (!destroy) { src->tail = tail; + assert(ringbuf_bytes_used(src) == bytes_used); } - - assert(count + ringbuf_bytes_used(src) == bytes_used); + else + { + assert(count + ringbuf_bytes_used(src) == bytes_used); + } return src->tail; }