From 9c7e8629876fb3ff115902e37fe562641ce9de11 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 6 Sep 2017 19:00:04 -0400 Subject: Clean up C and Python code-checker warnings. --- netlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'netlib.c') diff --git a/netlib.c b/netlib.c index 2939454d..4da16aaf 100644 --- a/netlib.c +++ b/netlib.c @@ -210,8 +210,8 @@ char *netlib_sock2ip(socket_t fd) /* retrieve the IP address corresponding to a socket */ { static char ip[INET6_ADDRSTRLEN]; - int r = 1; #ifdef HAVE_INET_NTOP + int r; sockaddr_t fsin; socklen_t alen = (socklen_t) sizeof(fsin); r = getpeername(fd, &(fsin.sa), &alen); @@ -232,9 +232,9 @@ char *netlib_sock2ip(socket_t fd) return ip; } } + /* Ugh... */ + if (r != 0) #endif /* HAVE_INET_NTOP */ - if (r != 0) { (void)strlcpy(ip, "", sizeof(ip)); - } return ip; } -- cgit v1.2.1