Commit dc4b750c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Don't reinvent the wheel^W^WANSI C

(or yet another "why make it complex when it can be simple")
parent 08c88156
...@@ -2853,18 +2853,6 @@ static void uri_decode_url_encoded( char *psz ) ...@@ -2853,18 +2853,6 @@ static void uri_decode_url_encoded( char *psz )
free( dup ); free( dup );
} }
static int char_in_str( char c, const char *str )
{
while( *str )
{
if( c == *str )
return 1;
str++;
}
return 0;
}
static void uri_encode( const char *from, char *to, size_t to_len ) static void uri_encode( const char *from, char *to, size_t to_len )
{ {
static const char hex[] = "0123456789abcdef"; static const char hex[] = "0123456789abcdef";
...@@ -2875,7 +2863,7 @@ static void uri_encode( const char *from, char *to, size_t to_len ) ...@@ -2875,7 +2863,7 @@ static void uri_encode( const char *from, char *to, size_t to_len )
{ {
*to++ = '+'; *to++ = '+';
} }
else if( isalnum( *from ) || char_in_str( *from, "$-_.+!*'(),/" ) ) else if( isalnum( *from ) || strchr( "$-_.+!*'(),/", *from ) )
{ {
*to++ = *from; *to++ = *from;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment