From df147e98df6210511b3569d51e02b021ef34063b Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 31 Jan 2020 23:33:28 -0800 Subject: Avoid use of VLAs --- sam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sam.c') diff --git a/sam.c b/sam.c index 5b4b636..0900c76 100644 --- a/sam.c +++ b/sam.c @@ -1389,9 +1389,9 @@ static int extract(Vis *vis, Win *win, Command *cmd, const char *argv[], Selecti bool trailing_match = false; size_t start = range->start, end = range->end, last_start = EPOS; size_t nsub = 1 + text_regex_nsub(cmd->regex); - if (nsub > 10) - nsub = 10; - RegexMatch match[nsub]; + if (nsub > MAX_REGEX_SUB) + nsub = MAX_REGEX_SUB; + RegexMatch match[MAX_REGEX_SUB]; while (start < end || trailing_match) { trailing_match = false; char c; -- cgit v1.2.3