system/helpers.cpp: getNowTimeStr(), use thread save localtime version

This commit is contained in:
2015-01-14 20:20:11 +01:00
parent 1cb885dfe9
commit 3538077821

View File

@@ -423,8 +423,9 @@ std::string getNowTimeStr(const char* format)
{
char tmpStr[256];
struct timeval tv;
struct tm t;
gettimeofday(&tv, NULL);
strftime(tmpStr, sizeof(tmpStr), format, localtime(&tv.tv_sec));
strftime(tmpStr, sizeof(tmpStr), format, localtime_r(&tv.tv_sec, &t));
return (std::string)tmpStr;
}