plugins/spellchk.c

changeset 8673
635af13bbcdb
parent 8672
b7978b580c00
child 8749
fb487e9e101a
equal deleted inserted replaced
8672:b7978b580c00 8673:635af13bbcdb
212 return tmp; 212 return tmp;
213 } 213 }
214 214
215 static void substitute(char **mes, int pos, int m, const char *text) { 215 static void substitute(char **mes, int pos, int m, const char *text) {
216 char *new = g_malloc(strlen(*mes) + strlen(text) + 1); 216 char *new = g_malloc(strlen(*mes) + strlen(text) + 1);
217 char *tmp;
217 new[0] = 0; 218 new[0] = 0;
218 219
219 strncat(new, *mes, pos); 220 strncat(new, *mes, pos);
220 strcat(new, text); 221 strcat(new, text);
221 222
222 strcat(new, &(*mes)[pos + m]); 223 strcat(new, &(*mes)[pos + m]);
223 g_free(*mes); 224 tmp = *mes;
224 *mes = new; 225 *mes = new;
226 g_free(tmp);
225 } 227 }
226 228
227 static GtkWidget *tree; 229 static GtkWidget *tree;
228 static GtkWidget *bad_entry; 230 static GtkWidget *bad_entry;
229 static GtkWidget *good_entry; 231 static GtkWidget *good_entry;
385 load_conf(); 387 load_conf();
386 388
387 gaim_signal_connect(conv_handle, "writing-im-msg", 389 gaim_signal_connect(conv_handle, "writing-im-msg",
388 plugin, GAIM_CALLBACK(substitute_words), NULL); 390 plugin, GAIM_CALLBACK(substitute_words), NULL);
389 gaim_signal_connect(conv_handle, "writing-chat-msg", 391 gaim_signal_connect(conv_handle, "writing-chat-msg",
390 plugin, GAIM_CALLBACK(substitute_words), NULL);
391 gaim_signal_connect(conv_handle, "sending-im-msg",
392 plugin, GAIM_CALLBACK(substitute_words), NULL); 392 plugin, GAIM_CALLBACK(substitute_words), NULL);
393 393
394 return TRUE; 394 return TRUE;
395 } 395 }
396 396

mercurial