Protect against localtime failures.

This commit is contained in:
Bartosz Taudul
2026-05-14 22:06:22 +02:00
parent 6789e7d6f9
commit a3cadb2fce

View File

@@ -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();