changeset 1293:fbc0cbf24a62

[gaim-migrate @ 1303] Rob and Deckin are LOOOOSEERS =) committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Mon, 18 Dec 2000 18:06:46 +0000
parents cb84b5c6d9ab
children 7f486375bfd5
files src/util.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.c	Mon Dec 18 05:17:58 2000 +0000
+++ b/src/util.c	Mon Dec 18 18:06:46 2000 +0000
@@ -1277,15 +1277,17 @@
 {
 	gchar *end = dest + destsize;
 
-	while (*src && dest < end) {
-		if (*src == '\n' && dest < end - 4) {
+	while (dest < end) {
+		if (*src == '\n' && dest < end - 5) {
 			strcpy(dest, "<BR>");
 			src++;
 			dest += 4;
-		} else
-			*dest++ = *src++;
+		} else {
+			*dest++ = *src;
+			if (*src == '\0') return;
+			else src++;
+		}
 	}
-	dest[destsize-1] = '\0';
 }