diff options
author | Brad King <brad.king@kitware.com> | 2017-10-04 11:28:34 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-10-10 15:15:16 (GMT) |
commit | 9e3ef40edb6eae36e822c129bec5d4ee9de0dd57 (patch) | |
tree | c739e929f90b5e6c4e26d4f5fea7f17d3772aefb /Utilities/cmcurl/lib/inet_ntop.c | |
parent | 2fad0e20b6b2b4c3cfc177267cf9689658f50c23 (diff) | |
parent | de7c21d677db1ddaeece03c19e13e448f4031511 (diff) | |
download | CMake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.zip CMake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.tar.gz CMake-9e3ef40edb6eae36e822c129bec5d4ee9de0dd57.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2017-10-04 (3ea76790)
Diffstat (limited to 'Utilities/cmcurl/lib/inet_ntop.c')
-rw-r--r-- | Utilities/cmcurl/lib/inet_ntop.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Utilities/cmcurl/lib/inet_ntop.c b/Utilities/cmcurl/lib/inet_ntop.c index 9afbdbb..fb91a50 100644 --- a/Utilities/cmcurl/lib/inet_ntop.c +++ b/Utilities/cmcurl/lib/inet_ntop.c @@ -63,7 +63,7 @@ static char *inet_ntop4 (const unsigned char *src, char *dst, size_t size) len = strlen(tmp); if(len == 0 || len >= size) { - SET_ERRNO(ENOSPC); + errno = ENOSPC; return (NULL); } strcpy(dst, tmp); @@ -141,8 +141,8 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) */ if(i == 6 && best.base == 0 && (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) { - if(!inet_ntop4(src+12, tp, sizeof(tmp) - (tp - tmp))) { - SET_ERRNO(ENOSPC); + if(!inet_ntop4(src + 12, tp, sizeof(tmp) - (tp - tmp))) { + errno = ENOSPC; return (NULL); } tp += strlen(tp); @@ -160,7 +160,7 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) /* Check for overflow, copy, and we're done. */ if((size_t)(tp - tmp) > size) { - SET_ERRNO(ENOSPC); + errno = ENOSPC; return (NULL); } strcpy(dst, tmp); @@ -177,8 +177,8 @@ static char *inet_ntop6 (const unsigned char *src, char *dst, size_t size) * * On Windows we store the error in the thread errno, not * in the winsock error code. This is to avoid losing the - * actual last winsock error. So use macro ERRNO to fetch the - * errno this function sets when returning NULL, not SOCKERRNO. + * actual last winsock error. So when this function returns + * NULL, check errno not SOCKERRNO. */ char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size) { @@ -190,7 +190,7 @@ char *Curl_inet_ntop(int af, const void *src, char *buf, size_t size) return inet_ntop6((const unsigned char *)src, buf, size); #endif default: - SET_ERRNO(EAFNOSUPPORT); + errno = EAFNOSUPPORT; return NULL; } } |