diff options
author | dzwdz | 2022-04-10 17:37:33 +0200 |
---|---|---|
committer | dzwdz | 2022-04-10 17:37:33 +0200 |
commit | 0ed2c976cc0bf569a3901be686a467150c089896 (patch) | |
tree | fc9389db2dc2950957fcd7c59ab9565c503f81d6 /src/shared/container | |
parent | 7022f39e10551d7ab325d196884de301ddb3087e (diff) |
kernel/driver: modify the ps2/serial drivers to use ring_t
Diffstat (limited to 'src/shared/container')
-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; } |