Mercurial > hg
changeset 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 | 0770da258c05 |
children | 4d7040cff8ee |
files | mcabber/src/screen.c mcabber/src/screen.h |
diffstat | 2 files changed, 13 insertions(+), 0 deletions(-) [+] |
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);
--- a/mcabber/src/screen.h Sun Jul 03 22:41:42 2005 +0100 +++ b/mcabber/src/screen.h Mon Jul 04 12:55:54 2005 +0100 @@ -16,6 +16,11 @@ #define INPUTLINE_LENGTH 1024 +// Only used in screen.c; this is the maximum line number +// in a multi-line message. Should be < 1000 +// Note: message length is limited by the HBB_BLOCKSIZE size too +#define MULTILINE_MAX_LINE_NUMBER 299 + extern int update_roster; void scr_InitCurses(void);