about summary refs log tree commit diff
path: root/ignore.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-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;
 }
>John Keeping 2013-03-20Convert pager navigation into a unordered listLukas Fleischer 2013-03-20Makefile: remove CGIT-CFLAGS files in clean stageJason A. Donenfeld 2013-03-20ui-summary.c: Move urls variable into print_urls()Lukas Fleischer 2013-03-20Fix colspan valuesLukas Fleischer 2013-03-20html: check return value of writeJason A. Donenfeld 2013-03-20ui-shared: squelch compiler warning.Jason A. Donenfeld 2013-03-20cgit.mk: Use SHELL_PATH_SQ to run gen-version.shJohn Keeping 2013-03-20cgit.mk: don't rebuild everything if CGIT_VERSION changesJohn Keeping 2013-03-20ui-patch: use cgit_version not CGIT_VERSIONJohn Keeping 2013-03-20Makefile: re-use Git's Makefile where possibleJohn Keeping