CComponentsFrmClock: use 'localtime_r'

Follow general recommendation to use 'localtime_r'
for threadsafe applications.
This commit is contained in:
2013-10-06 08:06:28 +02:00
parent 1af88c922b
commit d748680d66

View File

@@ -87,8 +87,10 @@ CComponentsFrmClock::~CComponentsFrmClock()
void CComponentsFrmClock::initTimeString() void CComponentsFrmClock::initTimeString()
{ {
time_t tm = time(0); struct tm t;
strftime((char*) &cl_timestr, sizeof(cl_timestr), cl_format_str, localtime(&tm)); time_t ltime;
ltime=time(&ltime);
strftime((char*) &cl_timestr, sizeof(cl_timestr), cl_format_str, localtime_r(&ltime, &t));
} }
// How does it works? // How does it works?