diff options
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; |