1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Merge pull request #848 from ailin-nemui/align-exhaust

limit alignment padding to a screenful
This commit is contained in:
ailin-nemui 2018-02-14 21:21:24 +01:00 committed by GitHub
commit dd2e3e6d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,6 +33,8 @@
#define isarg(c) \
(i_isdigit(c) || (c) == '*' || (c) == '~' || (c) == '-')
#define ALIGN_MAX 222488
static SPECIAL_HISTORY_FUNC history_func = NULL;
static char *get_argument(char **cmd, char **arglist)
@ -300,6 +302,10 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad)
if (!parse_uint(str, &endptr, 10, &align_)) {
return FALSE;
}
/* alignment larger than supported */
if (align_ > ALIGN_MAX) {
return FALSE;
}
str = endptr;
*align = align_;