about summary refs log tree commit diff stats
path: root/cache.c
diff options
context:
space:
mode:
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,
401static char *sprintftime(const char *format, time_t time) 401static char *sprintftime(const char *format, time_t time)
402{ 402{
403 static char buf[64]; 403 static char buf[64];
404 struct tm *tm; 404 struct tm tm;
405 405
406 if (!time) 406 if (!time)
407 return NULL; 407 return NULL;
408 tm = gmtime(&time); 408 gmtime_r(&time, &tm);
409 strftime(buf, sizeof(buf)-1, format, tm); 409 strftime(buf, sizeof(buf)-1, format, &tm);
410 return buf; 410 return buf;
411} 411}
412 412