CComponentsFrmClock: use 'localtime_r'

Follow general recommendation to use 'localtime_r'
for threadsafe applications.


Origin commit data
------------------
Branch: ni/coolstream
Commit: d748680d66
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-10-06 (Sun, 06 Oct 2013)



------------------
This commit was generated by Migit
This commit is contained in:
2013-10-06 08:06:28 +02:00
parent ad6f2eb210
commit 7614df21eb

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?