Fix localtime_r in game_screen.cpp: use localtime_s on Windows

This commit is contained in:
Kelsi 2026-02-18 18:50:27 -08:00
parent 16cf641298
commit 9d44d672d2

View file

@ -939,7 +939,11 @@ void GameScreen::renderChatWindow(game::GameHandler& gameHandler) {
if (chatShowTimestamps_) {
auto tt = std::chrono::system_clock::to_time_t(msg.timestamp);
std::tm tm{};
#ifdef _WIN32
localtime_s(&tm, &tt);
#else
localtime_r(&tt, &tm);
#endif
char tsBuf[16];
snprintf(tsBuf, sizeof(tsBuf), "[%02d:%02d] ", tm.tm_hour, tm.tm_min);
tsPrefix = tsBuf;