Merge branch 'master' of git.bro.org:bro

This commit is contained in:
Robin Sommer 2016-05-07 11:51:41 -07:00
commit 2e12d01eee
3 changed files with 35 additions and 13 deletions

View file

@ -576,7 +576,14 @@ const char* fmt_access_time(double t)
{
static char buf[256];
time_t time = (time_t) t;
strftime(buf, sizeof(buf), "%d/%m-%H:%M", localtime(&time));
struct tm ts;
if ( ! localtime_r(&time, &ts) )
{
reporter->InternalError("unable to get time");
}
strftime(buf, sizeof(buf), "%d/%m-%H:%M", &ts);
return buf;
}