# HG changeset patch # User Rob Flynn # Date 975984764 0 # Node ID d5146df6d2ab959baa30c6da8c83fe1cc91fd089 # Parent 90bb83cafb9e03ce48f526b451794d1ec3f26b7f [gaim-migrate @ 1212] Thanks, Decklin. committer: Tailor Script diff -r 90bb83cafb9e -r d5146df6d2ab src/util.c --- 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, "
"); - sp++; dp += 4; + while (dest < end) { + if (*src == '\n' && dest < end - 4) { + strcpy(dest, "
"); + src++; dest+=4; } - else *dp++ = *sp++; + else *dest++ = *src++; } }