diff options
| author | mycroft <mycroft@NetBSD.org> | 1995-05-21 00:39:11 +0000 |
|---|---|---|
| committer | mycroft <mycroft@NetBSD.org> | 1995-05-21 00:39:11 +0000 |
| commit | cc8066939dce5db90804b9534217b7bc23dfddc1 (patch) | |
| tree | 988d9a5807085d5cdb78706cfd28b9f4da6b8dc7 /libexec | |
| parent | cd7ca80fc2156fba905dca7902ef6825c2a6d7ee (diff) | |
Use inet_aton(), not inet_addr().
Diffstat (limited to 'libexec')
| -rw-r--r-- | libexec/identd/identd.c | 9 | ||||
| -rw-r--r-- | libexec/identd/parse.c | 8 |
2 files changed, 7 insertions, 10 deletions
diff --git a/libexec/identd/identd.c b/libexec/identd/identd.c index 8a23cfb7e0a..11d9ab799a5 100644 --- a/libexec/identd/identd.c +++ b/libexec/identd/identd.c @@ -1,5 +1,5 @@ /* -** $Id: identd.c,v 1.2 1994/02/04 23:17:56 cgd Exp $ +** $Id: identd.c,v 1.3 1995/05/21 00:39:11 mycroft Exp $ ** ** identd.c A TCP/IP link identification protocol server ** @@ -418,9 +418,7 @@ int main(argc,argv) addr.sin_addr.s_addr = htonl(INADDR_ANY); else { - if (isdigit(bind_address[0])) - addr.sin_addr.s_addr = inet_addr(bind_address); - else + if (inet_aton(bind_address, &addr.sin_addr) == 0) { struct hostent *hp; @@ -428,8 +426,7 @@ int main(argc,argv) if (!hp) ERROR1("no such address (%s) for -a switch", bind_address); - /* This is ugly, should use memcpy() or bcopy() but... */ - addr.sin_addr.s_addr = * (unsigned long *) (hp->h_addr); + memcpy(&addr.sin_addr, hp->h_addr, sizeof(addr.sin_addr)); } } diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c index 9a4b2163557..e60698546d3 100644 --- a/libexec/identd/parse.c +++ b/libexec/identd/parse.c @@ -1,5 +1,5 @@ /* -** $Id: parse.c,v 1.4 1994/12/23 14:29:36 cgd Exp $ +** $Id: parse.c,v 1.5 1995/05/21 00:39:13 mycroft Exp $ ** ** parse.c This file contains the protocol parser ** @@ -227,9 +227,9 @@ int parse(fp, laddr, faddr) } if (rcode == 4) - laddr2.s_addr = inet_addr(lhostaddr); + (void) inet_aton(lhostaddr, &laddr2); - faddr2.s_addr = inet_addr(fhostaddr); + (void) inet_aton(fhostaddr, &faddr2); proxy(&laddr2, &faddr2, lport, fport, NULL); continue; @@ -280,7 +280,7 @@ int parse(fp, laddr, faddr) continue; } - faddr2.s_addr = inet_addr(fhostaddr); + (void) inet_aton(fhostaddr, &faddr2); } else |
