aboutsummaryrefslogtreecommitdiffstats
path: root/lib/misc.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-05-19 20:46:43 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-05-19 20:46:43 +0100
commit0b3ffb13172c211eed561288d0fd04d76506bb02 (patch)
tree61b10a04029a860cdea017b6a31c479c27f06491 /lib/misc.c
parent2334048eaa9ab26fcdab781dbfb1bacb1c01ba8d (diff)
Setting the HTML flag on a connection has a nasty side effect of escaping
a lot of "special" characters, and these HTML entities are not counted as one character. :-( So just strip HTML of incoming stuff and don't do anything with what goes out. It's not required. The story may actually be more complicated this, let's find out.
Diffstat (limited to 'lib/misc.c')
-rw-r--r--lib/misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/misc.c b/lib/misc.c
index c56b31f3..d77972e3 100644
--- a/lib/misc.c
+++ b/lib/misc.c
@@ -153,11 +153,11 @@ static const htmlentity_t ent[] =
void strip_html( char *in )
{
char *start = in;
- char *out = g_malloc( strlen( in ) + 1 );
+ char out[strlen(in)+1];
char *s = out, *cs;
int i, matched;
- memset( out, 0, strlen( in ) + 1 );
+ memset( out, 0, sizeof( out ) );
while( *in )
{
@@ -219,7 +219,6 @@ void strip_html( char *in )
}
strcpy( start, out );
- g_free( out );
}
char *escape_html( const char *html )