From ca914eb17bfdb2e56a39951a96a9fb54e1a5f607 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Mon, 16 May 2016 17:05:36 +0200 Subject: lib: Add missing modulo calculation Adds a missing modulo calculation that would result in index -1 being returned instead of zero when the ringbuffer skipped back to the beginning. --- include/ouroboros/shm_ap_rbuff.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/ouroboros/shm_ap_rbuff.h') diff --git a/include/ouroboros/shm_ap_rbuff.h b/include/ouroboros/shm_ap_rbuff.h index 0ee3e81e..956a9540 100644 --- a/include/ouroboros/shm_ap_rbuff.h +++ b/include/ouroboros/shm_ap_rbuff.h @@ -37,8 +37,8 @@ struct shm_ap_rbuff; struct rb_entry { - size_t index; - int port_id; + ssize_t index; + int port_id; }; struct shm_ap_rbuff * shm_ap_rbuff_create(); -- cgit v1.2.3