mcabber/src/utils.c
changeset 655 de6837908702
parent 580 fed6d1e4d7a9
child 699 ee03b56b93ee
--- a/mcabber/src/utils.c	Sat Jan 07 12:17:49 2006 +0100
+++ b/mcabber/src/utils.c	Sat Jan 07 13:59:17 2006 +0100
@@ -446,4 +446,17 @@
   g_free(arglst);
 }
 
+//  replace_nl_with_dots(bufstr)
+// Replace '\n' with "(...)" (or with a NUL if the string is too short)
+void replace_nl_with_dots(char *bufstr)
+{
+  char *p = strchr(bufstr, '\n');
+  if (p) {
+    if (strlen(p) >= 5)
+      strcpy(p, "(...)");
+    else
+      *p = 0;
+  }
+}
+
 /* vim: set expandtab cindent cinoptions=>2\:2(0:  For Vim users... */