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 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,
408static char *sprintftime(const char *format, time_t time) 408static char *sprintftime(const char *format, time_t time)
409{ 409{
410 static char buf[64]; 410 static char buf[64];
411 struct tm *tm; 411 struct tm tm;
412 412
413 if (!time) 413 if (!time)
414 return NULL; 414 return NULL;
415 tm = gmtime(&time); 415 gmtime_r(&time, &tm);
416 strftime(buf, sizeof(buf)-1, format, tm); 416 strftime(buf, sizeof(buf)-1, format, &tm);
417 return buf; 417 return buf;
418} 418}
419 419