diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hostip4.c | 5 | ||||
-rw-r--r-- | lib/inet_pton.h | 10 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/hostip4.c b/lib/hostip4.c index ebbb9e375..97c42360a 100644 --- a/lib/hostip4.c +++ b/lib/hostip4.c @@ -79,6 +79,7 @@ #include "share.h" #include "strerror.h" #include "url.h" +#include "inet_pton.h" #define _MPRINTF_REPLACE /* use our functions only */ #include <curl/mprintf.h> @@ -202,11 +203,9 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn, *waitp = 0; /* don't wait, we act synchronously */ - in=inet_addr(hostname); - if (in != CURL_INADDR_NONE) { + if(1 == inet_pton(AF_INET, hostname, &in)) /* This is a dotted IP address 123.123.123.123-style */ return Curl_ip2addr(in, hostname, port); - } #if defined(HAVE_GETHOSTBYNAME_R) /* diff --git a/lib/inet_pton.h b/lib/inet_pton.h index b0a70d457..6d911eb7b 100644 --- a/lib/inet_pton.h +++ b/lib/inet_pton.h @@ -1,10 +1,10 @@ #ifndef __INET_PTON_H #define __INET_PTON_H /*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ + * _ _ ____ _ + * Project ___| | | | _ \| | + * / __| | | | |_) | | + * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al. @@ -12,7 +12,7 @@ * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms * are also available at http://curl.haxx.se/docs/copyright.html. - * + * * You may opt to use, copy, modify, merge, publish, distribute and/or sell * copies of the Software, and permit persons to whom the Software is * furnished to do so, under the terms of the COPYING file. |