aboutsummaryrefslogtreecommitdiff
path: root/sam.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-01-31 23:33:28 -0800
committerMarc André Tanner <mat@brain-dump.org>2020-04-27 10:45:42 +0200
commitdf147e98df6210511b3569d51e02b021ef34063b (patch)
tree989c6f6ed31477914bca514dd2e06c5dd22f84e6 /sam.c
parent348cf46dcbca5fecb342b59144a3ef6b36c3c857 (diff)
downloadvis-df147e98df6210511b3569d51e02b021ef34063b.tar.gz
vis-df147e98df6210511b3569d51e02b021ef34063b.tar.xz
Avoid use of VLAs
Diffstat (limited to 'sam.c')
-rw-r--r--sam.c6
1 files changed, 3 insertions, 3 deletions
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;