aboutsummaryrefslogtreecommitdiff
path: root/src/c-ringbuf/ringbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/c-ringbuf/ringbuf.c')
-rw-r--r--src/c-ringbuf/ringbuf.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/c-ringbuf/ringbuf.c b/src/c-ringbuf/ringbuf.c
index 048a622..8b8a738 100644
--- a/src/c-ringbuf/ringbuf.c
+++ b/src/c-ringbuf/ringbuf.c
@@ -284,9 +284,12 @@ ringbuf_memcpy_from(void *dst, ringbuf_t src, size_t count, bool destroy)
if (!destroy)
{
src->tail = tail;
+ assert(ringbuf_bytes_used(src) == bytes_used);
+ }
+ else
+ {
+ assert(count + ringbuf_bytes_used(src) == bytes_used);
}
-
- assert(count + ringbuf_bytes_used(src) == bytes_used);
return src->tail;
}