aboutsummaryrefslogtreecommitdiffstats
path: root/cache.c
diff options
context:
space:
mode:
authorla-ninpre <leobrekalini@gmail.com>2021-03-30 19:59:13 +0300
committerla-ninpre <leobrekalini@gmail.com>2021-03-30 19:59:13 +0300
commitccd0d09e29ed887a848bd6d79bddfc218be8ecd7 (patch)
treeba16c428ffedb167752eeda3ad9c90089baa631e /cache.c
parentd366ec1e1e796937387208ef8c26097e5ff44ae9 (diff)
parentbd6f5683f6cde4212364354b3139c1d521f40f39 (diff)
downloadcgit-ccd0d09e29ed887a848bd6d79bddfc218be8ecd7.tar.gz
cgit-ccd0d09e29ed887a848bd6d79bddfc218be8ecd7.zip
Merge remote-tracking branch 'upstream/master' into git.aaoth.xyz
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 2c70be7..55199e8 100644
--- a/cache.c
+++ b/cache.c
@@ -401,12 +401,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;
}