comparison 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
comparison
equal deleted inserted replaced
1190:c3ebd5932e32 1191:4fd0d35826fe
1230 ret = g_slist_append(ret, g_strndup(&message[lastgood], limit)); 1230 ret = g_slist_append(ret, g_strndup(&message[lastgood], limit));
1231 lastgood += limit; 1231 lastgood += limit;
1232 } 1232 }
1233 } 1233 }
1234 } 1234 }
1235
1236 void strncpy_withhtml(gchar *dest, const gchar *src, size_t destsize)
1237 {
1238 gchar *sp = src, *dp = dest;
1239
1240 while (dp < dest+destsize) {
1241 if (*sp == '\n' && dp < dest+destsize-4) {
1242 strcpy(dp, "<BR>");
1243 sp++; dp += 4;
1244 }
1245 else *dp++ = *sp++;
1246 }
1247 }