diff options
| author | Michael Forney <mforney@mforney.org> | 2020-01-31 23:33:28 -0800 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2020-04-27 10:45:42 +0200 |
| commit | df147e98df6210511b3569d51e02b021ef34063b (patch) | |
| tree | 989c6f6ed31477914bca514dd2e06c5dd22f84e6 /sam.c | |
| parent | 348cf46dcbca5fecb342b59144a3ef6b36c3c857 (diff) | |
| download | vis-df147e98df6210511b3569d51e02b021ef34063b.tar.gz vis-df147e98df6210511b3569d51e02b021ef34063b.tar.xz | |
Avoid use of VLAs
Diffstat (limited to 'sam.c')
| -rw-r--r-- | sam.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |
