summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/escape.c
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities/cmcurl/lib/escape.c')
-rw-r--r--Utilities/cmcurl/lib/escape.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Utilities/cmcurl/lib/escape.c b/Utilities/cmcurl/lib/escape.c
index 5af00c3..4eb53ad 100644
--- a/Utilities/cmcurl/lib/escape.c
+++ b/Utilities/cmcurl/lib/escape.c
@@ -70,7 +70,8 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string,
return strdup("");
while(length--) {
- unsigned char in = *string++; /* treat the characters unsigned */
+ /* treat the characters unsigned */
+ unsigned char in = (unsigned char)*string++;
if(ISUNRESERVED(in)) {
/* append this */
@@ -137,7 +138,7 @@ CURLcode Curl_urldecode(const char *string, size_t length,
*ostring = ns;
while(alloc) {
- unsigned char in = *string;
+ unsigned char in = (unsigned char)*string;
if(('%' == in) && (alloc > 2) &&
ISXDIGIT(string[1]) && ISXDIGIT(string[2])) {
/* this is two hexadecimal digits following a '%' */
@@ -157,7 +158,7 @@ CURLcode Curl_urldecode(const char *string, size_t length,
return CURLE_URL_MALFORMAT;
}
- *ns++ = in;
+ *ns++ = (char)in;
}
*ns = 0; /* terminate it */
@@ -222,8 +223,8 @@ void Curl_hexencode(const unsigned char *src, size_t len, /* input length */
while(len-- && (olen >= 3)) {
/* clang-tidy warns on this line without this comment: */
/* NOLINTNEXTLINE(clang-analyzer-core.UndefinedBinaryOperatorResult) */
- *out++ = hex[(*src & 0xF0)>>4];
- *out++ = hex[*src & 0x0F];
+ *out++ = (unsigned char)hex[(*src & 0xF0)>>4];
+ *out++ = (unsigned char)hex[*src & 0x0F];
++src;
olen -= 2;
}