summaryrefslogtreecommitdiffstats
path: root/lib/inet_pton.c
diff options
context:
space:
mode:
authorCurl Upstream <curl-library@cool.haxx.se>2016-12-22 15:41:14 (GMT)
committerBrad King <brad.king@kitware.com>2017-02-07 16:37:30 (GMT)
commit4cc2908fdaaf1ab8afe5c2ae5dbb3401859a9aab (patch)
treeef3a36a4eb9b0c43881db54e61574378e104b936 /lib/inet_pton.c
parent93cc249f3dd7ecd621cd063e4c08bbdb54d971e8 (diff)
downloadCMake-4cc2908fdaaf1ab8afe5c2ae5dbb3401859a9aab.zip
CMake-4cc2908fdaaf1ab8afe5c2ae5dbb3401859a9aab.tar.gz
CMake-4cc2908fdaaf1ab8afe5c2ae5dbb3401859a9aab.tar.bz2
curl 2016-12-22 (44b9b4d4)
Code extracted from: https://github.com/curl/curl.git at commit 44b9b4d4f56d6f6de92c89636994c03984e9cd01 (curl-7_52_1).
Diffstat (limited to 'lib/inet_pton.c')
-rw-r--r--lib/inet_pton.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/inet_pton.c b/lib/inet_pton.c
index cf8b88a..475f44a 100644
--- a/lib/inet_pton.c
+++ b/lib/inet_pton.c
@@ -65,7 +65,7 @@ static int inet_pton6(const char *src, unsigned char *dst);
int
Curl_inet_pton(int af, const char *src, void *dst)
{
- switch (af) {
+ switch(af) {
case AF_INET:
return (inet_pton4(src, (unsigned char *)dst));
#ifdef ENABLE_IPV6
@@ -103,7 +103,8 @@ inet_pton4(const char *src, unsigned char *dst)
while((ch = *src++) != '\0') {
const char *pch;
- if((pch = strchr(digits, ch)) != NULL) {
+ pch = strchr(digits, ch);
+ if(pch) {
unsigned int val = *tp * 10 + (unsigned int)(pch - digits);
if(saw_digit && *tp == 0)
@@ -169,7 +170,8 @@ inet_pton6(const char *src, unsigned char *dst)
while((ch = *src++) != '\0') {
const char *pch;
- if((pch = strchr((xdigits = xdigits_l), ch)) == NULL)
+ pch = strchr((xdigits = xdigits_l), ch);
+ if(!pch)
pch = strchr((xdigits = xdigits_u), ch);
if(pch != NULL) {
val <<= 4;