Unused variable fix

This commit is contained in:
def 2018-12-17 17:27:36 +01:00
parent 4c39539d38
commit d0a887f688

View file

@ -1547,7 +1547,6 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
{ {
#ifndef FUZZING #ifndef FUZZING
char sockaddrbuf[128]; char sockaddrbuf[128];
socklen_t fromlen;
int bytes = 0; int bytes = 0;
#if defined(CONF_PLATFORM_LINUX) #if defined(CONF_PLATFORM_LINUX)
@ -1583,13 +1582,13 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
#else #else
if(bytes == 0 && sock.ipv4sock >= 0) 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); bytes = recvfrom(sock.ipv4sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
} }
if(bytes <= 0 && sock.ipv6sock >= 0) 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); bytes = recvfrom(sock.ipv6sock, (char*)data, maxsize, 0, (struct sockaddr *)&sockaddrbuf, &fromlen);
} }
#endif #endif
@ -1597,7 +1596,7 @@ int net_udp_recv(NETSOCKET sock, NETADDR *addr, void *data, int maxsize, MMSGS*
#if defined(CONF_WEBSOCKETS) #if defined(CONF_WEBSOCKETS)
if(bytes <= 0 && sock.web_ipv4sock >= 0) 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); bytes = websocket_recv(sock.web_ipv4sock, data, maxsize, (struct sockaddr_in *)&sockaddrbuf, fromlen);
((struct sockaddr_in *)&sockaddrbuf)->sin_family = AF_WEBSOCKET_INET; ((struct sockaddr_in *)&sockaddrbuf)->sin_family = AF_WEBSOCKET_INET;
} }