localtime to localtime_r

This commit is contained in:
Markus Gans 2021-06-16 21:55:11 +02:00
parent 85ae1612fd
commit c4376bae3e
1 changed files with 2 additions and 1 deletions

View File

@ -110,9 +110,10 @@ Watch::Watch (FWidget* parent)
void Watch::printTime()
{
finalcut::FString str{};
struct tm local_tm;
using namespace std::chrono;
auto now = system_clock::to_time_t(system_clock::now());
auto lt = *localtime(&now);
auto lt = *localtime_r(&now, &local_tm);
if ( sec )
str.sprintf("%02d:%02d:%02d", lt.tm_hour, lt.tm_min, lt.tm_sec);