diff options
Diffstat (limited to 'libs/libcurl/src/escape.c')
-rw-r--r-- | libs/libcurl/src/escape.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libs/libcurl/src/escape.c b/libs/libcurl/src/escape.c index 1b708a64f6..e7796713c7 100644 --- a/libs/libcurl/src/escape.c +++ b/libs/libcurl/src/escape.c @@ -29,6 +29,8 @@ #include <curl/curl.h>
+struct Curl_easy;
+
#include "urldata.h"
#include "warnless.h"
#include "escape.h"
@@ -53,7 +55,7 @@ char *curl_unescape(const char *string, int length) /* Escapes for URL the given unescaped string of given length.
* 'data' is ignored since 7.82.0.
*/
-char *curl_easy_escape(struct Curl_easy *data, const char *string,
+char *curl_easy_escape(CURL *data, const char *string,
int inlength)
{
size_t length;
@@ -63,7 +65,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string, if(!string || (inlength < 0))
return NULL;
- length = (inlength?(size_t)inlength:strlen(string));
+ length = (inlength ? (size_t)inlength : strlen(string));
if(!length)
return strdup("");
@@ -82,7 +84,7 @@ char *curl_easy_escape(struct Curl_easy *data, const char *string, /* encode it */
const char hex[] = "0123456789ABCDEF";
char out[3]={'%'};
- out[1] = hex[in>>4];
+ out[1] = hex[in >> 4];
out[2] = hex[in & 0xf];
if(Curl_dyn_addn(&d, out, 3))
return NULL;
@@ -128,7 +130,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, DEBUGASSERT(string);
DEBUGASSERT(ctrl >= REJECT_NADA); /* crash on TRUE/FALSE */
- alloc = (length?length:strlen(string));
+ alloc = (length ? length : strlen(string));
ns = malloc(alloc + 1);
if(!ns)
@@ -176,7 +178,7 @@ CURLcode Curl_urldecode(const char *string, size_t length, * If olen == NULL, no output length is stored.
* 'data' is ignored since 7.82.0.
*/
-char *curl_easy_unescape(struct Curl_easy *data, const char *string,
+char *curl_easy_unescape(CURL *data, const char *string,
int length, int *olen)
{
char *str = NULL;
@@ -223,7 +225,7 @@ 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++ = (unsigned char)hex[(*src & 0xF0)>>4];
+ *out++ = (unsigned char)hex[(*src & 0xF0) >> 4];
*out++ = (unsigned char)hex[*src & 0x0F];
++src;
olen -= 2;
|