diff options
Diffstat (limited to 'src/shared/container/ring.c')
-rw-r--r-- | src/shared/container/ring.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/container/ring.c b/src/shared/container/ring.c index 525fade..8c56acd 100644 --- a/src/shared/container/ring.c +++ b/src/shared/container/ring.c @@ -27,7 +27,7 @@ void ring_put1b(ring_t *r, uint8_t byte) { size_t ring_get(ring_t *r, void *buf, size_t len) { for (size_t i = 0; i < len; i++) { - if (at_end(r)) return i; + if (r->_head == r->_tail || at_end(r)) return i; ((uint8_t*)buf)[i] = ((uint8_t*)r->buf)[r->_tail++]; if (r->_tail >= r->capacity) r->_tail = 0; } |