size_t/int/long fixes
This commit is contained in:
parent
3fa4ac080e
commit
a684c51c9b
@ -39,11 +39,11 @@
|
|||||||
|
|
||||||
char *curl_escape(const char *string, int length)
|
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 *ns = malloc(alloc);
|
||||||
char *testing_ptr = NULL;
|
char *testing_ptr = NULL;
|
||||||
unsigned char in;
|
unsigned char in;
|
||||||
int newlen = alloc;
|
size_t newlen = alloc;
|
||||||
int strindex=0;
|
int strindex=0;
|
||||||
|
|
||||||
length = alloc-1;
|
length = alloc-1;
|
||||||
@ -89,7 +89,7 @@ char *curl_unescape(const char *string, int length)
|
|||||||
char *ns = malloc(alloc);
|
char *ns = malloc(alloc);
|
||||||
unsigned char in;
|
unsigned char in;
|
||||||
int strindex=0;
|
int strindex=0;
|
||||||
unsigned int hex;
|
long hex;
|
||||||
|
|
||||||
if( !ns ) {
|
if( !ns ) {
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -107,7 +107,7 @@ char *curl_unescape(const char *string, int length)
|
|||||||
|
|
||||||
hex = strtol(hexstr, &ptr, 16);
|
hex = strtol(hexstr, &ptr, 16);
|
||||||
|
|
||||||
in = hex;
|
in = (unsigned char)hex; /* this long is never bigger than 255 anyway */
|
||||||
string+=2;
|
string+=2;
|
||||||
alloc-=2;
|
alloc-=2;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user