diff options
author | kevlo <kevlo@FreeBSD.org> | 2013-10-15 07:37:30 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2013-10-15 07:37:30 +0000 |
commit | 25842b5eb9566e24190ca4a633b15807d757a91e (patch) | |
tree | c4d4787170d251b8a1370041f91909fb34d82a1f /usr.sbin/ypset | |
parent | 69104cedb7bd1435005fd8226e3a2cd06d3de77c (diff) | |
download | FreeBSD-src-25842b5eb9566e24190ca4a633b15807d757a91e.zip FreeBSD-src-25842b5eb9566e24190ca4a633b15807d757a91e.tar.gz |
Use INADDR_NONE instead of -1 to check inet_addr() result.
Reviewed by: glebius
Diffstat (limited to 'usr.sbin/ypset')
-rw-r--r-- | usr.sbin/ypset/ypset.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ypset/ypset.c b/usr.sbin/ypset/ypset.c index b63578a..d77909e 100644 --- a/usr.sbin/ypset/ypset.c +++ b/usr.sbin/ypset/ypset.c @@ -75,7 +75,7 @@ bind_tohost(struct sockaddr_in *sin, char *dom, char *server) bcopy (hp->h_addr_list[0], (u_long *)&ypsd.ypsetdom_binding.ypbind_binding_addr, sizeof (unsigned long)); - } else if ((long)(server_addr = inet_addr (server)) == -1) { + } else if ((server_addr = inet_addr(server)) == INADDR_NONE) { errx(1, "can't find address for %s", server); } else bcopy (&server_addr, @@ -129,7 +129,8 @@ main(int argc, char *argv[]) domainname = optarg; break; case 'h': - if ((sin.sin_addr.s_addr = inet_addr(optarg)) == -1) { + if ((sin.sin_addr.s_addr = inet_addr(optarg)) == + INADDR_NONE) { hent = gethostbyname(optarg); if (hent == NULL) errx(1, "host %s unknown", optarg); |