diff options
author | araujo <araujo@FreeBSD.org> | 2016-04-18 14:12:42 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2016-04-18 14:12:42 +0000 |
commit | 7c5409f82bd191c4d93ade12415082af0f55b9fe (patch) | |
tree | b91c3d1d53f090e5f1a3d70f28676693b8f3a196 | |
parent | 3ed503ef4c0407af39685611fc218f503b26e57f (diff) | |
download | FreeBSD-src-7c5409f82bd191c4d93ade12415082af0f55b9fe.zip FreeBSD-src-7c5409f82bd191c4d93ade12415082af0f55b9fe.tar.gz |
User NULL instead of 0 for pointers.
gethostbyname(3) will return NULL in case of an error.
MFC after: 2 weeks.
-rw-r--r-- | sbin/ifconfig/af_inet.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ifconfig/af_inet.c b/sbin/ifconfig/af_inet.c index eff1ce5..1d205a6 100644 --- a/sbin/ifconfig/af_inet.c +++ b/sbin/ifconfig/af_inet.c @@ -133,10 +133,10 @@ in_getaddr(const char *s, int which) if (inet_aton(s, &sin->sin_addr)) return; - if ((hp = gethostbyname(s)) != 0) + if ((hp = gethostbyname(s)) != NULL) bcopy(hp->h_addr, (char *)&sin->sin_addr, MIN((size_t)hp->h_length, sizeof(sin->sin_addr))); - else if ((np = getnetbyname(s)) != 0) + else if ((np = getnetbyname(s)) != NULL) sin->sin_addr = inet_makeaddr(np->n_net, INADDR_ANY); else errx(1, "%s: bad value", s); |