changeset 1946:4e93ea84f7dd

[gaim-migrate @ 1956] whoops. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 01 Jun 2001 23:25:26 +0000
parents ee1adc242b11
children e0631236c970
files src/util.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.c	Fri Jun 01 23:22:38 2001 +0000
+++ b/src/util.c	Fri Jun 01 23:25:26 2001 +0000
@@ -555,11 +555,10 @@
 	/* Assumes you have a buffer able to cary at least BUF_LEN * 2 bytes */
 	if (strlen(msg) > BUF_LEN) {
 		fprintf(stderr, "Warning:  truncating message to 2048 bytes\n");
-		msg[2047] = '\0';
 	}
 
 	woo = malloc(strlen(msg) * 4 + 1);
-	cpy = g_strdup(msg);
+	cpy = g_strndup(msg, 2048);
 	c = cpy;
 	while (*c) {
 		switch (*c) {