summaryrefslogtreecommitdiffstats
path: root/src/idna.c
diff options
context:
space:
mode:
authorlibuv upstream <libuv@googlegroups.com>2022-07-12 16:16:33 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-27 13:49:38 (GMT)
commita23da1559648995998343f3ae63076db736b55a5 (patch)
treef16d7ac9fb0a52f8d57b3828bc5179aa75b7cb53 /src/idna.c
parent09ec116d91c571dff0f108c23eabbcccdca767fa (diff)
downloadCMake-a23da1559648995998343f3ae63076db736b55a5.zip
CMake-a23da1559648995998343f3ae63076db736b55a5.tar.gz
CMake-a23da1559648995998343f3ae63076db736b55a5.tar.bz2
libuv 2022-07-12 (0c1fa696)
Code extracted from: https://github.com/libuv/libuv.git at commit 0c1fa696aa502eb749c2c4735005f41ba00a27b8 (v1.44.2).
Diffstat (limited to 'src/idna.c')
-rw-r--r--src/idna.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/idna.c b/src/idna.c
index b44cb16..93d982c 100644
--- a/src/idna.c
+++ b/src/idna.c
@@ -21,6 +21,7 @@
#include "idna.h"
#include <assert.h>
#include <string.h>
+#include <limits.h> /* UINT_MAX */
static unsigned uv__utf8_decode1_slow(const char** p,
const char* pe,
@@ -129,7 +130,7 @@ static int uv__idna_toascii_label(const char* s, const char* se,
while (s < se) {
c = uv__utf8_decode1(&s, se);
- if (c == -1u)
+ if (c == UINT_MAX)
return UV_EINVAL;
if (c < 128)
@@ -151,7 +152,7 @@ static int uv__idna_toascii_label(const char* s, const char* se,
s = ss;
while (s < se) {
c = uv__utf8_decode1(&s, se);
- assert(c != -1u);
+ assert(c != UINT_MAX);
if (c > 127)
continue;
@@ -182,7 +183,7 @@ static int uv__idna_toascii_label(const char* s, const char* se,
while (s < se) {
c = uv__utf8_decode1(&s, se);
- assert(c != -1u);
+ assert(c != UINT_MAX);
if (c >= n)
if (c < m)
@@ -201,7 +202,7 @@ static int uv__idna_toascii_label(const char* s, const char* se,
s = ss;
while (s < se) {
c = uv__utf8_decode1(&s, se);
- assert(c != -1u);
+ assert(c != UINT_MAX);
if (c < n)
if (++delta == 0)
@@ -280,7 +281,7 @@ long uv__idna_toascii(const char* s, const char* se, char* d, char* de) {
st = si;
c = uv__utf8_decode1(&si, se);
- if (c == -1u)
+ if (c == UINT_MAX)
return UV_EINVAL;
if (c != '.')