Skip to content
Snippets Groups Projects
Commit a8ec624a authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

core: cib: fix overflow handling

parent 2c46e092
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ static inline unsigned int cib_full(const cib_t *cib)
*/
static inline int cib_get(cib_t *__restrict cib)
{
if (cib->write_count > cib->read_count) {
if (cib_avail(cib)) {
return (int) (cib->read_count++ & cib->mask);
}
......@@ -108,7 +108,7 @@ static inline int cib_get(cib_t *__restrict cib)
*/
static inline int cib_peek(cib_t *__restrict cib)
{
if (cib->write_count > cib->read_count) {
if (cib_avail(cib)) {
return (int) (cib->read_count & cib->mask);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment