summaryrefslogtreecommitdiff
path: root/lib/escape.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-02-24 00:03:06 +0000
committerYang Tse <yangsita@gmail.com>2010-02-24 00:03:06 +0000
commit5695c4db861e3c3f200005ae428c89cd3ad6ccdb (patch)
tree5bdb249f29dffeec6784322ec111efcd8f80a609 /lib/escape.c
parentaa0f8593b9b97948c509cbb475a9f184b9650e02 (diff)
downloadcurl-5695c4db861e3c3f200005ae428c89cd3ad6ccdb.tar.gz
fix compiler warning
Diffstat (limited to 'lib/escape.c')
-rw-r--r--lib/escape.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/escape.c b/lib/escape.c
index 3164f908a..e28e02099 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -35,6 +35,7 @@
/* urldata.h and easyif.h are included for Curl_convert_... prototypes */
#include "urldata.h"
#include "easyif.h"
+#include "warnless.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
@@ -152,7 +153,7 @@ char *curl_easy_unescape(CURL *handle, const char *string, int length,
char *ns = malloc(alloc);
unsigned char in;
int strindex=0;
- long hex;
+ unsigned long hex;
#ifndef CURL_DOES_CONVERSIONS
/* avoid compiler warnings */
@@ -171,9 +172,9 @@ char *curl_easy_unescape(CURL *handle, const char *string, int length,
hexstr[1] = string[2];
hexstr[2] = 0;
- hex = strtol(hexstr, &ptr, 16);
+ hex = strtoul(hexstr, &ptr, 16);
- in = (unsigned char)hex; /* this long is never bigger than 255 anyway */
+ in = curlx_ultouc(hex); /* this long is never bigger than 255 anyway */
#ifdef CURL_DOES_CONVERSIONS
/* escape sequences are always in ASCII so convert them on non-ASCII hosts */