| 845 } |
845 } |
| 846 |
846 |
| 847 static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int flags) |
847 static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int flags) |
| 848 { |
848 { |
| 849 char buf[BUF_LEN * 2]; |
849 char buf[BUF_LEN * 2]; |
| 850 char *tmp = g_malloc(strlen(message) * 2); |
850 char *tmp = g_malloc(strlen(message) * 4 + 1); /* 4 because \n gets replaced with <BR> */ |
| 851 |
851 |
| 852 strcpy(tmp, message); |
852 strcpy(tmp, message); |
| 853 escape_text(tmp); |
853 escape_text(tmp); |
| 854 if (strlen(tmp) + 52 > MSG_LEN) { |
854 if (strlen(tmp) + 52 > MSG_LEN) { |
| 855 g_free(tmp); |
855 g_free(tmp); |