diff src/util.c @ 1191:4fd0d35826fe

[gaim-migrate @ 1201] thanks to decklin for this patch. for some reason the logic in strcpy_withhtml looks funny to me. i'm sure it's just me though. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 03 Dec 2000 09:50:39 +0000
parents 201ec77f3a60
children 0af0a11af61e
line wrap: on
line diff
--- a/src/util.c	Sat Dec 02 20:02:59 2000 +0000
+++ b/src/util.c	Sun Dec 03 09:50:39 2000 +0000
@@ -1232,3 +1232,16 @@
 		}
 	}
 }
+
+void strncpy_withhtml(gchar *dest, const gchar *src, size_t destsize)
+{
+	gchar *sp = src, *dp = dest;
+
+	while (dp < dest+destsize) {
+                if (*sp == '\n' && dp < dest+destsize-4) {
+                    strcpy(dp, "<BR>");
+                    sp++; dp += 4;
+                }
+                else *dp++ = *sp++;
+	}
+}