aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-08 08:38:29 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-08 08:38:29 +0000
commita684c51c9b2e055e409b77dc0a61d96bdec7490f (patch)
tree556bb83bd253e97f03593dffcf1c5ffa432037c0
parent3fa4ac080ef776e109500ca43966251f2dfd1dbd (diff)
size_t/int/long fixes
-rw-r--r--lib/escape.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/escape.c b/lib/escape.c
index 87a9f1b9e..23c3821fa 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -39,11 +39,11 @@
char *curl_escape(const char *string, int length)
{
- int alloc = (length?length:(int)strlen(string))+1;
+ size_t alloc = (length?(size_t)length:strlen(string))+1;
char *ns = malloc(alloc);
char *testing_ptr = NULL;
unsigned char in;
- int newlen = alloc;
+ size_t newlen = alloc;
int strindex=0;
length = alloc-1;
@@ -89,7 +89,7 @@ char *curl_unescape(const char *string, int length)
char *ns = malloc(alloc);
unsigned char in;
int strindex=0;
- unsigned int hex;
+ long hex;
if( !ns ) {
return NULL;
@@ -107,7 +107,7 @@ char *curl_unescape(const char *string, int length)
hex = strtol(hexstr, &ptr, 16);
- in = hex;
+ in = (unsigned char)hex; /* this long is never bigger than 255 anyway */
string+=2;
alloc-=2;
}