summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/windows/packet_peer_udp_winsock.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/platform/windows/packet_peer_udp_winsock.cpp b/platform/windows/packet_peer_udp_winsock.cpp
index aff92b8fc8..34192e318a 100644
--- a/platform/windows/packet_peer_udp_winsock.cpp
+++ b/platform/windows/packet_peer_udp_winsock.cpp
@@ -121,7 +121,7 @@ Error PacketPeerUDPWinsock::_poll(bool p_wait) {
struct sockaddr_in from = {0};
int len = sizeof(struct sockaddr_in);
int ret;
- while ( (ret = recvfrom(sockfd, (char*)recv_buffer, MIN(sizeof(recv_buffer),rb.data_left()-12), 0, (struct sockaddr*)&from, &len)) > 0) {
+ while ( (ret = recvfrom(sockfd, (char*)recv_buffer, MIN(sizeof(recv_buffer),rb.space_left()-12), 0, (struct sockaddr*)&from, &len)) > 0) {
rb.write((uint8_t*)&from.sin_addr, 4);
uint32_t port = ntohs(from.sin_port);
rb.write((uint8_t*)&port, 4);