mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
Unused variable fix
This commit is contained in:
parent
4c39539d38
commit
d0a887f688
|
@ -1547,7 +1547,6 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
|
|||
{
|
||||
#ifndef FUZZING
|
||||
char sockaddrbuf[128];
|
||||
socklen_t fromlen;
|
||||
int bytes = 0;
|
||||
|
||||
#if defined(CONF_PLATFORM_LINUX)
|
||||
|
@ -1583,13 +1582,13 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
|
|||
#else
|
||||
if(bytes == 0 && sock.ipv4sock >= 0)
|
||||
{
|
||||
fromlen = sizeof(struct sockaddr_in);
|
||||
socklen_t fromlen = sizeof(struct sockaddr_in);
|
||||
bytes = recvfrom(sock.ipv4sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
|
||||
}
|
||||
|
||||
if(bytes <= 0 && sock.ipv6sock >= 0)
|
||||
{
|
||||
fromlen = sizeof(struct sockaddr_in6);
|
||||
socklen_t fromlen = sizeof(struct sockaddr_in6);
|
||||
bytes = recvfrom(sock.ipv6sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
|
||||
}
|
||||
#endif
|
||||
|
@ -1597,7 +1596,7 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
|
|||
#if defined(CONF_WEBSOCKETS)
|
||||
if(bytes <= 0 && sock.web_ipv4sock >= 0)
|
||||
{
|
||||
fromlen = sizeof(struct sockaddr);
|
||||
socklen_t fromlen = sizeof(struct sockaddr);
|
||||
bytes = websocket_recv(sock.web_ipv4sock, data, maxsize, (struct sockaddr_in *)&sockaddrbuf, fromlen);
|
||||
((struct sockaddr_in *)&sockaddrbuf)->sin_family = AF_WEBSOCKET_INET;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue