plugins/spellchk.c

changeset 8672
b7978b580c00
parent 8596
6d70d45b8ea6
child 8673
635af13bbcdb
--- a/plugins/spellchk.c	Fri Apr 16 04:39:03 2004 +0000
+++ b/plugins/spellchk.c	Fri Apr 16 14:39:34 2004 +0000
@@ -214,16 +214,14 @@
 
 static void substitute(char **mes, int pos, int m, const char *text) {
 	char *new = g_malloc(strlen(*mes) + strlen(text) + 1);
-	char *tmp;
 	new[0] = 0;
 
 	strncat(new, *mes, pos);
 	strcat(new, text);
 
 	strcat(new, &(*mes)[pos + m]);
-	tmp = *mes;
+	g_free(*mes);
 	*mes = new;
-	g_free(tmp);
 }
 
 static GtkWidget *tree;
@@ -390,6 +388,8 @@
 						plugin, GAIM_CALLBACK(substitute_words), NULL);
 	gaim_signal_connect(conv_handle, "writing-chat-msg",
 						plugin, GAIM_CALLBACK(substitute_words), NULL);
+	gaim_signal_connect(conv_handle, "sending-im-msg",
+						plugin, GAIM_CALLBACK(substitute_words), NULL);
 
 	return TRUE;
 }

mercurial