diff options
author | Damien Miller <djm@mindrot.org> | 2000-07-08 11:50:37 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-07-08 11:50:37 +1000 |
commit | 8e394e7ed51a2fcdd5088e1c8fcc8b5b8033eb85 (patch) | |
tree | 3f5077dc28c4c037a63707cc0fe6265dc76acfad /fake-getaddrinfo.c | |
parent | f2fdbe5540c3954bd62a6ec6d701132a65110d27 (diff) |
- (djm) Don't use inet_addr.
Diffstat (limited to 'fake-getaddrinfo.c')
-rw-r--r-- | fake-getaddrinfo.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fake-getaddrinfo.c b/fake-getaddrinfo.c index b3af4aa2e..c9bc03a35 100644 --- a/fake-getaddrinfo.c +++ b/fake-getaddrinfo.c | |||
@@ -65,6 +65,7 @@ int getaddrinfo(const char *hostname, const char *servname, | |||
65 | { | 65 | { |
66 | struct addrinfo *cur, *prev = NULL; | 66 | struct addrinfo *cur, *prev = NULL; |
67 | struct hostent *hp; | 67 | struct hostent *hp; |
68 | struct in_addr in; | ||
68 | int i, port; | 69 | int i, port; |
69 | 70 | ||
70 | if (servname) | 71 | if (servname) |
@@ -86,8 +87,8 @@ int getaddrinfo(const char *hostname, const char *servname, | |||
86 | return EAI_MEMORY; | 87 | return EAI_MEMORY; |
87 | } | 88 | } |
88 | 89 | ||
89 | if (inet_addr(hostname) != -1) { | 90 | if (inet_aton(hostname, &in) != -1) { |
90 | if (NULL != (*res = malloc_ai(port, inet_addr(hostname)))) | 91 | if (NULL != (*res = malloc_ai(port, in.s_addr))) |
91 | return 0; | 92 | return 0; |
92 | else | 93 | else |
93 | return EAI_MEMORY; | 94 | return EAI_MEMORY; |