X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/b31e99887b17f513289fb11227b2484504e85b6c..73e98c16e8c63f0061d2b7e792c3b7d0552c05a9:/cache.c 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; }