I have the following code
FRAME frameArray[5][10]; // Create the array of frames int trackBufferFull[5] = {0, 0, 0, 0, 0};// Keeps track of how full the buffer f
You're modifying trackTail[nodeNumber - 1] between sequence points. It's like you're assigning
trackTail[nodeNumber - 1]
i = ++i;
which is also undefined behaviour.
Change your code to something like this:
trackTail[nodeNumber - 1] = (trackTail[nodeNumber - 1] + 1) % 10;