summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ignore.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ignore.c b/ignore.c
index 7fecb16..d53d138 100644
--- a/ignore.c
+++ b/ignore.c
@@ -45,17 +45,19 @@ const char *ignoreAdd(const char *pattern) {
 		if (*ch == ' ') sp++;
 	}
 	char **dest = &ignore.patterns[ignore.len++];
+	int n = 0;
 	if (!ex && !sp) {
-		asprintf(dest, "%s!*@* * * *", pattern);
+		n = asprintf(dest, "%s!*@* * * *", pattern);
 	} else if (sp < 1) {
-		asprintf(dest, "%s * * *", pattern);
+		n = asprintf(dest, "%s * * *", pattern);
 	} else if (sp < 2) {
-		asprintf(dest, "%s * *", pattern);
+		n = asprintf(dest, "%s * *", pattern);
 	} else if (sp < 3) {
-		asprintf(dest, "%s *", pattern);
+		n = asprintf(dest, "%s *", pattern);
 	} else {
 		*dest = strdup(pattern);
 	}
+	if (n < 0) err(EX_OSERR, "asprintf");
 	if (!*dest) err(EX_OSERR, "strdup");
 	return *dest;
 }
usic.md to music.txtJune McEnroe 2019-12-23Add DO YOU DOUBT ME TRAITORJune McEnroe 2019-12-22Add license header to cgit CSSJune McEnroe 2019-12-22Add The Book of EttaJune McEnroe 2019-12-21Revert "Add first working version of imbox"June McEnroe 2019-12-21Add first working version of imboxJune McEnroe 2019-12-20Respect mailmap in gl pretty formatJune McEnroe 2019-12-20Set LANG in cgit filtersJune McEnroe 2019-12-20Source .editrc before applying -v or -eJune McEnroe 2019-12-20Disable signing commitsJune McEnroe 2019-12-19Ignore about-filterJune McEnroe 2019-12-19Fix matching make tags with no sourcesJune McEnroe 2019-12-19Avoid matching := assignments as tagsJune McEnroe 2019-12-18Hide line numbers when rendering mdocJune McEnroe 2019-12-18Customize cgit CSSJune McEnroe 2019-12-18Use :target rather than :focus pseudo-classJune McEnroe 2019-12-18Copy cgit auxiliary binaries properlyJune McEnroe 2019-12-18Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe 2019-12-16Post "cgit setup"June McEnroe