diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2017-09-06 19:00:04 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2017-09-06 19:00:04 -0400 |
commit | 9c7e8629876fb3ff115902e37fe562641ce9de11 (patch) | |
tree | 08ca2e4206ccc0dbda2ee946d907763ae9166aab /netlib.c | |
parent | db56959e1cf2670edb02f27f25580bb4272e9df2 (diff) | |
download | gpsd-9c7e8629876fb3ff115902e37fe562641ce9de11.tar.gz |
Clean up C and Python code-checker warnings.
Diffstat (limited to 'netlib.c')
-rw-r--r-- | netlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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, "<unknown>", sizeof(ip)); - } return ip; } |