changeset 2136:73253b36c3cb

[gaim-migrate @ 2146] i wonder if this will help anything. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 08 Aug 2001 19:13:01 +0000
parents 1779daad8cc3
children 18722ae5b882
files src/protocols/toc/toc.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/toc/toc.c	Wed Aug 08 17:34:23 2001 +0000
+++ b/src/protocols/toc/toc.c	Wed Aug 08 19:13:01 2001 +0000
@@ -744,14 +744,19 @@
 static int toc_send_im(struct gaim_connection *gc, char *name, char *message, int away)
 {
 	char buf[BUF_LEN * 2];
+	char *tmp = g_malloc(strlen(message) * 2);
 
-	escape_text(message);
-	if (strlen(message) + 52 > MSG_LEN)
+	strcpy(tmp, message);
+	escape_text(tmp);
+	if (strlen(tmp) + 52 > MSG_LEN) {
+		g_free(tmp);
 		return -E2BIG;
+	}
 	g_snprintf(buf, MSG_LEN - 8, "toc_send_im %s \"%s\"%s", normalize(name),
-		   message, ((away) ? " auto" : ""));
+		   tmp, ((away) ? " auto" : ""));
 	sflap_send(gc, buf, -1, TYPE_DATA);
 	
+	g_free(tmp);
 	return 0;
 }