Skip to content

Commit 59bfc5f

Browse files
committed
Circular buffer: Iterate by item
1 parent 60a22f4 commit 59bfc5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/lib/circular_buffer.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void circular_buffer_iterate(
102102

103103
size_t i = cb->tail;
104104
do {
105-
callback(&cb->buffer[i], data);
105+
callback(cb->buffer + i * cb->item_size, data);
106106
increment(cb, &i);
107107
} while (i != cb->head);
108108
}

0 commit comments

Comments
 (0)