704ecc34fb
Fixes #6756 because the ringbuf size is zero and the empty check does % which leads to division by zero error.