From a3cadb2fcee3885fb63d391cdd9fa563865c247a Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 14 May 2026 22:06:22 +0200 Subject: [PATCH] Protect against localtime failures. --- profiler/src/profiler/TracyLlm.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index b170fce3..20dd6943 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -918,11 +918,13 @@ void TracyLlm::UpdateSystemPrompt() time_t et = exectime; auto elt = localtime( &et ); - strftime( etime, 64, "%F %T", elt ); + if( elt ) strftime( etime, 64, "%F %T", elt ); + else strcpy( etime, "unknown" ); time_t ct = capturetime; auto clt = localtime( &ct ); - strftime( ctime, 64, "%F %T", clt ); + if( clt ) strftime( ctime, 64, "%F %T", clt ); + else strcpy( ctime, "unknown" ); std::string descStr; const auto& desc = m_view.GetUserData().GetDescription();