aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/misc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/misc.c b/lib/misc.c
index fe2ff17c..04418524 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -263,11 +263,10 @@ void http_decode( char *s )
/* This fuction is safe, but make sure you call it safely as well! */
void http_encode( char *s )
{
- char *t;
+ char t[strlen(s)+1];
int i, j;
- t = g_strdup( s );
-
+ strcpy( t, s );
for( i = j = 0; t[i]; i ++, j ++ )
{
/* if( t[i] <= ' ' || ((unsigned char *)t)[i] >= 128 || t[i] == '%' ) */
@@ -282,8 +281,6 @@ void http_encode( char *s )
}
}
s[j] = 0;
-
- g_free( t );
}
/* Strip newlines from a string. Modifies the string passed to it. */