mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +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()
|
||||
{
|
||||
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