aboutsummaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/misc.c b/lib/misc.c
index b696b8c4..55575d8f 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -297,11 +297,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 ++ )
{
/* Warning: isalnum() is locale-aware, so don't use it here! */
@@ -319,8 +318,6 @@ void http_encode( char *s )
}
}
s[j] = 0;
-
- g_free( t );
}
/* Strip newlines from a string. Modifies the string passed to it. */