summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-05-17 18:19:43 -0400
committerJune McEnroe <june@causal.agency>2021-05-17 18:19:43 -0400
commit981d5ae9f308630c477def539a57ac9b51613718 (patch)
tree5f7280f1a2b728495dd944c4620fb7edd793af05
parentAvoid VLAs (diff)
downloadlitterbox-981d5ae9f308630c477def539a57ac9b51613718.tar.gz
litterbox-981d5ae9f308630c477def539a57ac9b51613718.zip
Allocate 1 + ParamCap matches in unscoop
The IRC KICK matcher uses all 8 params, but there is always an extra
match for the whole thing.
Diffstat (limited to '')
-rw-r--r--unscoop.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unscoop.c b/unscoop.c
index 72bf65f..4779278 100644
--- a/unscoop.c
+++ b/unscoop.c
@@ -286,8 +286,8 @@ static void
 matchLine(const struct Format *format, const regex_t *regex, const char *line) {
 	for (size_t i = 0; i < format->len; ++i) {
 		const struct Matcher *matcher = &format->matchers[i];
-		regmatch_t match[ParamCap];
-		if (regexec(&regex[i], line, ParamCap, match, 0)) continue;
+		regmatch_t match[1 + ParamCap];
+		if (regexec(&regex[i], line, 1 + ParamCap, match, 0)) continue;
 
 		sqlite3_clear_bindings(insertName);
 		for (int i = 1; i <= sqlite3_bind_parameter_count(insertEvent); ++i) {
McEnroe 2020-11-04Remove modified sensitivity settingsJune McEnroe 2020-10-29Remove editJune McEnroe 2020-10-27Switch gr alias back to git rebaseJune McEnroe 2020-10-27Allow cd host: to cd to same path over sshJune McEnroe 2020-10-27Use SendEnv for cd host:pathJune McEnroe 2020-10-27Allow cd host:path over sshJune McEnroe 2020-10-07Use mandoc -T utf8 for text.June McEnroe 2020-09-20Add The Awakened KingdomJune McEnroe 2020-09-12Move /opt/local back, cheat port select to use system manJune McEnroe 2020-09-12Move /opt/local behind /usr againJune McEnroe 2020-09-12Enable toc in cgit renderings of man pagesJune McEnroe 2020-09-11Install mandoc on macOSJune McEnroe 2020-09-11Rewrite install script yet againJune McEnroe 2020-09-11Remove NetBSD from install scriptJune McEnroe 2020-09-11Use MacPorts rather than pkgsrcJune McEnroe 2020-09-11Add debian VM name to sshJune McEnroe 2020-09-11Add influencer tweetJune McEnroe 2020-09-10Add The Kingdom of GodsJune McEnroe 2020-09-07Add SunglassesJune McEnroe 2020-09-06Add Between the BreathsJune McEnroe 2020-09-04Open /dev/tty in nudgeJune McEnroe 2020-09-04Add nudgeJune McEnroe 2020-09-03Build fbclock with -lzJune McEnroe 2020-08-29Add tweets from retweetsJune McEnroe