mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
Core/Misc: Remove unsafe not thread-safe localtime() calls
Replace not thread-safe localtime() calls with thread-safe localtime_r().
This commit is contained in:
@@ -280,7 +280,8 @@ public:
|
||||
// Format creation date
|
||||
char createdDateStr[20];
|
||||
time_t createdDate = guild->GetCreatedDate();
|
||||
strftime(createdDateStr, 20, "%Y-%m-%d %H:%M:%S", localtime(&createdDate));
|
||||
tm localTm;
|
||||
strftime(createdDateStr, 20, "%Y-%m-%d %H:%M:%S", localtime_r(&createdDate, &localTm));
|
||||
|
||||
handler->PSendSysMessage(LANG_GUILD_INFO_CREATION_DATE, createdDateStr); // Creation Date
|
||||
handler->PSendSysMessage(LANG_GUILD_INFO_MEMBER_COUNT, guild->GetMemberCount()); // Number of Members
|
||||
|
||||
Reference in New Issue
Block a user