mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
CComponentsFrmClock: use 'localtime_r'
Follow general recommendation to use 'localtime_r'
for threadsafe applications.
Origin commit data
------------------
Commit: d748680d66
Author: Thilo Graf <dbt@novatux.de>
Date: 2013-10-06 (Sun, 06 Oct 2013)
This commit is contained in:
@@ -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(<ime);
|
||||||
|
strftime((char*) &cl_timestr, sizeof(cl_timestr), cl_format_str, localtime_r(<ime, &t));
|
||||||
}
|
}
|
||||||
|
|
||||||
// How does it works?
|
// How does it works?
|
||||||
|
Reference in New Issue
Block a user