mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix localtime_r in game_screen.cpp: use localtime_s on Windows
This commit is contained in:
parent
16cf641298
commit
9d44d672d2
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue