changeset 1403:ae6887d9ab46

rename hidden variable in function tcp_acceptor() struct sockaddr_storage addr; char* addr = NULL;
author Francois Perrad <francois.perrad@gadz.org>
date Sat, 19 Nov 2016 15:07:42 +0100
parents 553c6bb80265
children e8f67918fdc9
files tcp-accept.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/tcp-accept.c	Sat Nov 19 10:47:18 2016 +0100
+++ b/tcp-accept.c	Sat Nov 19 15:07:42 2016 +0100
@@ -55,19 +55,19 @@
 static void tcp_acceptor(struct Listener *listener, int sock) {
 
 	int fd;
-	struct sockaddr_storage addr;
+	struct sockaddr_storage sa;
 	socklen_t len;
 	char ipstring[NI_MAXHOST], portstring[NI_MAXSERV];
 	struct TCPListener *tcpinfo = (struct TCPListener*)(listener->typedata);
 
-	len = sizeof(addr);
+	len = sizeof(sa);
 
-	fd = accept(sock, (struct sockaddr*)&addr, &len);
+	fd = accept(sock, (struct sockaddr*)&sa, &len);
 	if (fd < 0) {
 		return;
 	}
 
-	if (getnameinfo((struct sockaddr*)&addr, len, ipstring, sizeof(ipstring),
+	if (getnameinfo((struct sockaddr*)&sa, len, ipstring, sizeof(ipstring),
 				portstring, sizeof(portstring), 
 				NI_NUMERICHOST | NI_NUMERICSERV) != 0) {
 		m_close(fd);