summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--fake-getaddrinfo.c5
2 files changed, 4 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index be8ba3569..b2bef47c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
1120000702 1220000702
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;