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()
|
||||
{
|
||||
time_t tm = time(0);
|
||||
strftime((char*) &cl_timestr, sizeof(cl_timestr), cl_format_str, localtime(&tm));
|
||||
struct tm t;
|
||||
time_t ltime;
|
||||
ltime=time(<ime);
|
||||
strftime((char*) &cl_timestr, sizeof(cl_timestr), cl_format_str, localtime_r(<ime, &t));
|
||||
}
|
||||
|
||||
// How does it works?
|
||||
|
Reference in New Issue
Block a user