mirror of
https://github.com/nmap/nmap.git
synced 2025-12-18 13:39:02 +00:00
Code cleanup.
Made get_peeraddr_string() return "peer unspecified" if peerlen <= 0. This saves a handful duplicate lines that did the check externally.
This commit is contained in:
@@ -186,7 +186,10 @@ static char *get_addr_string(const struct sockaddr_storage *ss, size_t sslen) {
|
||||
* string containing path to UNIX socket if the address family is AF_UNIX,
|
||||
* otherwise it returns string containing "<address>:<port>". */
|
||||
char *get_peeraddr_string(const msiod *iod) {
|
||||
return get_addr_string(&iod->peer, iod->peerlen);
|
||||
if (iod->peerlen > 0)
|
||||
return get_addr_string(&iod->peer, iod->peerlen);
|
||||
else
|
||||
return "peer unspecified";
|
||||
}
|
||||
|
||||
/* Get the local bind address string. */
|
||||
|
||||
Reference in New Issue
Block a user