What steps will reproduce the problem?
1. Using function peektail
2.
3.
What is the expected output? What do you see instead?
Thought it might help someone else...
Output is ok until int pos reaches the circular buffer size, then it returns
random characters.
Below is the corrected function:
char peekTail(circular* buf, int pos) {
pos+=buf->tail;
pos&=0x3FF;
return buf->buf[pos%CIRCULAR_BUFFER_SIZE];
}
Original issue reported on code.google.com by chrismn...@gmail.com on 20 Sep 2015 at 3:39
Original issue reported on code.google.com by
chrismn...@gmail.com
on 20 Sep 2015 at 3:39