summaryrefslogtreecommitdiff
path: root/toxcore/Lossless_UDP.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/Lossless_UDP.c')
-rw-r--r--toxcore/Lossless_UDP.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c
index ca8ba8e0..01f9ccc2 100644
--- a/toxcore/Lossless_UDP.c
+++ b/toxcore/Lossless_UDP.c
@@ -480,19 +480,19 @@ uint32_t recvqueue(Lossless_UDP *ludp, int connection_id)
480} 480}
481 481
482/* return the id of the next packet in the queue. 482/* return the id of the next packet in the queue.
483 * return -1 if no packet in queue. 483 * return ~0 if no packet in queue.
484 */ 484 */
485char id_packet(Lossless_UDP *ludp, int connection_id) 485uint8_t id_packet(Lossless_UDP *ludp, int connection_id)
486{ 486{
487 if (recvqueue(ludp, connection_id) == 0) 487 if (recvqueue(ludp, connection_id) == 0)
488 return -1; 488 return ~0;
489 489
490 Connection *connection = &tox_array_get(&ludp->connections, connection_id, Connection); 490 Connection *connection = &tox_array_get(&ludp->connections, connection_id, Connection);
491 491
492 if (connection->status != LUDP_NO_CONNECTION) 492 if (connection->status != LUDP_NO_CONNECTION)
493 return connection->recvbuffer[connection->successful_read % connection->recvbuffer_length].data[0]; 493 return connection->recvbuffer[connection->successful_read % connection->recvbuffer_length].data[0];
494 494
495 return -1; 495 return ~0;
496} 496}
497 497
498/* return 0 if there is no received data in the buffer. 498/* return 0 if there is no received data in the buffer.