1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-21 06:39:42 +00:00

Merge branch 'deprecated' into 'master'

Replace gmtime with safer equivalents

See merge request OpenMW/openmw!2503
This commit is contained in:
psi29a 2022-11-09 09:20:07 +00:00
commit 577c9ad5fb

View file

@ -1321,7 +1321,13 @@ namespace MWScript
msg << "Report time: ";
std::time_t currentTime = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
msg << std::put_time(std::gmtime(&currentTime), "%Y.%m.%d %T UTC") << std::endl;
tm timeinfo{};
#ifdef _WIN32
gmtime_s(&timeinfo, &currentTime);
#else
gmtime_r(&currentTime, &timeinfo);
#endif
msg << std::put_time(&timeinfo, "%Y.%m.%d %T UTC") << std::endl;
msg << "Content file: " << ptr.getCellRef().getRefNum().mContentFile;