about summary refs log tree commit diff
path: root/cache.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-13 12:07:49 -0500
committerJune McEnroe <june@causal.agency>2022-02-13 12:10:49 -0500
commit516175469a8c6895496ef909b487992deb45f460 (patch)
treee0e8b4d38f05e870089de8babc0d3aca3bb4d3b0 /cache.c
parentFix crash trying to print "this commit" on 404s (diff)
parentgit: update to v2.32.0 (diff)
downloadcgit-pink-516175469a8c6895496ef909b487992deb45f460.tar.gz
cgit-pink-516175469a8c6895496ef909b487992deb45f460.zip
Merge up to git v2.32.0
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cache.c b/cache.c
index 580c0e8..578b73b 100644
--- a/cache.c
+++ b/cache.c
@@ -408,12 +408,12 @@ int cache_process(int size, const char *path, const char *key, int ttl,
 static char *sprintftime(const char *format, time_t time)
 {
 	static char buf[64];
-	struct tm *tm;
+	struct tm tm;
 
 	if (!time)
 		return NULL;
-	tm = gmtime(&time);
-	strftime(buf, sizeof(buf)-1, format, tm);
+	gmtime_r(&time, &tm);
+	strftime(buf, sizeof(buf)-1, format, &tm);
 	return buf;
 }