diff libpurple/protocols/irc/parse.c @ 23251:996c80ab3dbc

Remove an unnecessary strdup when sending messages over IRC.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 30 May 2008 04:33:44 +0000
parents ef4ac2a83e1c
children 106a912f1ef5 0aa090fde749
line wrap: on
line diff
--- a/libpurple/protocols/irc/parse.c	Fri May 30 01:51:43 2008 +0000
+++ b/libpurple/protocols/irc/parse.c	Fri May 30 04:33:44 2008 +0000
@@ -232,7 +232,7 @@
 
 	if (encodings[0] == NULL || !g_ascii_strcasecmp("UTF-8", encodings[0])) {
 		g_strfreev(encodings);
-		return g_strdup(string);
+		return NULL;
 	}
 
 	utf8 = g_convert(string, strlen(string), encodings[0], "UTF-8", NULL, NULL, &err);
@@ -597,7 +597,7 @@
 		case 'n':
 		case 'c':
 			tmp = irc_send_convert(irc, tok);
-			g_string_append(string, tmp);
+			g_string_append(string, tmp ? tmp : tok);
 			g_free(tmp);
 			break;
 		default: