preventing reading from past the end of the message queue

This commit is contained in:
PS 2021-04-08 13:54:26 -10:00
parent 95107a2685
commit cd2cfac16e
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ MessageQueue_Read(blumen_network_msg_queue* Queue)
if (ReadIndex >= BLUMEN_MESSAGE_QUEUE_COUNT)
{
Queue->ReadHead = 0;
ReadIndex = 0;
}
Result = Queue->Buffers[ReadIndex];
return Result;