89. Circular Buffer-I

Question.3

A UART ISR pushes incoming bytes into a circular buffer. The buffer is already full (count == capacity). The ISR doesn't check for fullness and pushes anyway:

void isr_push(CircularBuffer *cb, uint8_t data) {
   cb->buffer[cb->head] = data;
   cb->head = (cb->head + 1) % cb->capacity;
   cb->count++;
}

What is the consequence?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!