Replaced all instances of localtime with localtime_r

This commit is contained in:
Thulinma 2018-05-21 09:52:47 +02:00
parent 3ce86d0e4c
commit 2d9e9f3c8b
4 changed files with 8 additions and 4 deletions

View file

@ -310,9 +310,10 @@ namespace Util{
}
time_t rawtime;
struct tm *timeinfo;
struct tm timetmp;
char buffer[100];
time(&rawtime);
timeinfo = localtime(&rawtime);
timeinfo = localtime_r(&rawtime, &timetmp);
strftime(buffer, 100, "%F %H:%M:%S", timeinfo);
dprintf(out, "%s[%s] ", color_time, buffer);
if (progname && progpid && strlen(progname) && strlen(progpid)){