mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsFrmClock: use 'localtime_r'
Follow general recommendation to use 'localtime_r' for threadsafe applications.
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