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 --- text-regex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'text-regex.c') diff --git a/text-regex.c b/text-regex.c index 56ecafc..7c6812e 100644 --- a/text-regex.c +++ b/text-regex.c @@ -45,7 +45,7 @@ int text_search_range_forward(Text *txt, size_t pos, size_t len, Regex *r, size_ return REG_NOMATCH; char *cur = buf, *end = buf + len; int ret = REG_NOMATCH; - regmatch_t match[nmatch]; + regmatch_t match[MAX_REGEX_SUB]; for (size_t junk = len; len > 0; len -= junk, pos += junk) { ret = regexec(&r->regex, cur, nmatch, match, eflags); if (!ret) { @@ -73,7 +73,7 @@ int text_search_range_backward(Text *txt, size_t pos, size_t len, Regex *r, size return REG_NOMATCH; char *cur = buf, *end = buf + len; int ret = REG_NOMATCH; - regmatch_t match[nmatch]; + regmatch_t match[MAX_REGEX_SUB]; for (size_t junk = len; len > 0; len -= junk, pos += junk) { char *next; if (!regexec(&r->regex, cur, nmatch, match, eflags)) { -- cgit v1.2.3