diff mcabber/src/screen.c @ 276:627925d885de

Limit the number of lines in multi-line messages
author Mikael Berthe <mikael@lilotux.net>
date Mon, 04 Jul 2005 12:55:54 +0100
parents 3c07026f1b47
children f5dd437c057b
line wrap: on
line diff
--- a/mcabber/src/screen.c	Sun Jul 03 22:41:42 2005 +0100
+++ b/mcabber/src/screen.c	Mon Jul 04 12:55:54 2005 +0100
@@ -1167,6 +1167,14 @@
       scr_LogPrint("Please send this part now...");
       return;
     }
+    if (num >= MULTILINE_MAX_LINE_NUMBER) {
+      // We don't allow too many lines; however the maximum is arbitrary
+      // (It should be < 1000 yet)
+      scr_LogPrint("Your message has too many lines, this one has "
+                   "not been added.");
+      scr_LogPrint("Please send this part now...");
+      return;
+    }
     multiline = g_renew(char, multiline, len);
     strcat(multiline, "\n");
     strcat(multiline, line);