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 | |
parent | f2fdbe5540c3954bd62a6ec6d701132a65110d27 (diff) |
- (djm) Don't use inet_addr.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | fake-getaddrinfo.c | 5 |
2 files changed, 4 insertions, 2 deletions
@@ -7,6 +7,7 @@ | |||
7 | Baars, Henk <Hendrik.Baars@nl.origin-it.com> | 7 | Baars, Henk <Hendrik.Baars@nl.origin-it.com> |
8 | - (djm) Handle EWOULDBLOCK returns from read() and write() in atomicio.c | 8 | - (djm) Handle EWOULDBLOCK returns from read() and write() in atomicio.c |
9 | Fix from Marquess, Steve Mr JMLFDC <Steve.Marquess@DET.AMEDD.ARMY.MIL> | 9 | Fix from Marquess, Steve Mr JMLFDC <Steve.Marquess@DET.AMEDD.ARMY.MIL> |
10 | - (djm) Don't use inet_addr. | ||
10 | 11 | ||
11 | 20000702 | 12 | 20000702 |
12 | - (djm) Fix brace mismatch from Corinna Vinschen <vinschen@cygnus.com> | 13 | - (djm) Fix brace mismatch from Corinna Vinschen <vinschen@cygnus.com> |
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; |