changeset 1202:d5146df6d2ab

[gaim-migrate @ 1212] Thanks, Decklin. committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Tue, 05 Dec 2000 02:52:44 +0000
parents 90bb83cafb9e
children 17193fb97b12
files src/util.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/util.c	Tue Dec 05 00:18:19 2000 +0000
+++ b/src/util.c	Tue Dec 05 02:52:44 2000 +0000
@@ -1235,13 +1235,13 @@
 
 void strncpy_withhtml(gchar *dest, const gchar *src, size_t destsize)
 {
-	gchar *sp =src, *dp = dest;
+	gchar *end = dest + destsize;
 
-	while (dp < dest+destsize) {
-                if (*sp == '\n' && dp < dest+destsize-4) {
-                    strcpy(dp, "<BR>");
-                    sp++; dp += 4;
+	while (dest < end) {
+		if (*src == '\n' && dest < end - 4) {
+			strcpy(dest, "<BR>");
+			src++; dest+=4;
                 }
-                else *dp++ = *sp++;
+		else *dest++ = *src++;
 	}
 }