From d0a887f688c290c8119aad4e29ccc776e1ebcc7e Mon Sep 17 00:00:00 2001 From: def Date: Mon, 17 Dec 2018 17:27:36 +0100 Subject: [PATCH] Unused variable fix --- src/base/system.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/base/system.c b/src/base/system.c index 08498a626..09b4dacbc 100644 --- a/src/base/system.c +++ b/src/base/system.c @@ -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; }