If head == tail, the buffer is empty.  When writing, the last spot is always kept open to distinguish empty from full.  The extra byte is so the effective capacity matches the requested size.