src/protocols/toc/toc.c

changeset 2136
b90fe6b900db
parent 2130
bda8eb781932
child 2137
b0c18ea1dee8
equal deleted inserted replaced
2135:8c6c6501d0f2 2136:b90fe6b900db
742 } 742 }
743 743
744 static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int away) 744 static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int away)
745 { 745 {
746 char buf[BUF_LEN * 2]; 746 char buf[BUF_LEN * 2];
747 747 char *tmp = g_malloc(strlen(message) * 2);
748 escape_text(message); 748
749 if (strlen(message) + 52 > MSG_LEN) 749 strcpy(tmp, message);
750 escape_text(tmp);
751 if (strlen(tmp) + 52 > MSG_LEN) {
752 g_free(tmp);
750 return -E2BIG; 753 return -E2BIG;
754 }
751 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name), 755 g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
752 message, ((away) ? " auto" : "")); 756 tmp, ((away) ? " auto" : ""));
753 sflap_send(gc, buf, -1, TYPE_DATA); 757 sflap_send(gc, buf, -1, TYPE_DATA);
754 758
759 g_free(tmp);
755 return 0; 760 return 0;
756 } 761 }
757 762
758 static void toc_set_config(struct gaim_connection *gc) 763 static void toc_set_config(struct gaim_connection *gc)
759 { 764 {

mercurial