about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--shared.c9
-rw-r--r--ui-shared.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/shared.c b/shared.c
index d7b2d5a..a27ab30 100644
--- a/shared.c
+++ b/shared.c
@@ -406,12 +406,17 @@ int readfile(const char *path, char **buf, size_t *size)
 	fd = open(path, O_RDONLY);
 	if (fd == -1)
 		return errno;
-	if (fstat(fd, &st))
+	if (fstat(fd, &st)) {
+		close(fd);
 		return errno;
-	if (!S_ISREG(st.st_mode))
+	}
+	if (!S_ISREG(st.st_mode)) {
+		close(fd);
 		return EISDIR;
+	}
 	*buf = xmalloc(st.st_size + 1);
 	*size = read_in_full(fd, *buf, st.st_size);
 	(*buf)[*size] = '\0';
+	close(fd);
 	return (*size == st.st_size ? 0 : errno);
 }
diff --git a/ui-shared.c b/ui-shared.c
index 6cb7edb..3a9e67b 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -20,7 +20,7 @@ static char *http_date(time_t t)
 		{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
 	static char month[][4] =
 		{"Jan", "Feb", "Mar", "Apr", "May", "Jun",
-		 "Jul", "Aug", "Sep", "Oct", "Now", "Dec"};
+		 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 	struct tm *tm = gmtime(&t);
 	return fmt("%s, %02d %s %04d %02d:%02d:%02d GMT", day[tm->tm_wday],
 		   tm->tm_mday, month[tm->tm_mon], 1900+tm->tm_year,
3c60fa93&follow=1'>Add git.causal.agency cgit configJune McEnroe 2019-12-18Bail from hi if input is binaryJune McEnroe 2019-12-16Post "cgit setup"June McEnroe/a> 3.4.2June McEnroe 2021-11-29Import LibreSSL 3.4.2June McEnroe 2021-10-14Import LibreSSL 3.4.1June McEnroe 2021-09-17Import LibreSSL 3.4.0June McEnroe 2021-08-24Import LibreSSL 3.3.4June McEnroe 2021-05-25Bump version to 3.3.3p1 3.3.3p1June McEnroe 2021-05-25build: Add scripts to EXTRA_DISTJune McEnroe 2021-05-25import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe Some compat sources (getentropy_linux.c for example) require OpenSSL. Reported by Robert Scheck. 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe