diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-05-21 22:15:58 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-05-21 22:15:58 +0200 |
commit | 4d69cc1c567180b408ddbadb9edf26859cf4c006 (patch) | |
tree | a40d455e3b460861541f1d1d3f44943d07b9fbd1 /src/common/Logging/LogMessage.cpp | |
parent | 92a289e45518e6a4c3a34fed6d28f09002e53352 (diff) |
Core/Misc: GCC build and warning fixes
Diffstat (limited to 'src/common/Logging/LogMessage.cpp')
-rw-r--r-- | src/common/Logging/LogMessage.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/Logging/LogMessage.cpp b/src/common/Logging/LogMessage.cpp index fd5285efba8..143203946e8 100644 --- a/src/common/Logging/LogMessage.cpp +++ b/src/common/Logging/LogMessage.cpp @@ -16,6 +16,7 @@ */ #include "LogMessage.h" +#include "StringFormat.h" #include "Util.h" LogMessage::LogMessage(LogLevel _level, std::string const& _type, std::string&& _text) @@ -32,9 +33,7 @@ std::string LogMessage::getTimeStr(time_t time) { tm aTm; localtime_r(&time, &aTm); - char buf[20]; - snprintf(buf, 20, "%04d-%02d-%02d_%02d:%02d:%02d", aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec); - return std::string(buf); + return Trinity::StringFormat("%04d-%02d-%02d_%02d:%02d:%02d", aTm.tm_year + 1900, aTm.tm_mon + 1, aTm.tm_mday, aTm.tm_hour, aTm.tm_min, aTm.tm_sec); } std::string LogMessage::getTimeStr() |