diff options
author | leak <leak@bitmx.net> | 2014-06-22 15:42:46 +0200 |
---|---|---|
committer | leak <leak@bitmx.net> | 2014-06-22 15:42:46 +0200 |
commit | 7dd6f0f1d8dcd14c8b9306553170f0023d30fc66 (patch) | |
tree | 02ff8f931f5a3f972bf5b1cf9c56c89697f82139 /src/server/shared/Utilities/Util.cpp | |
parent | ccf3374e494c31f52c9ae3b63480e3cc6fd2510d (diff) |
Replaced all ACE_OS::localtime_r calls
Diffstat (limited to 'src/server/shared/Utilities/Util.cpp')
-rw-r--r-- | src/server/shared/Utilities/Util.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index c766cc3ca91..f80730af05d 100644 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -139,15 +139,14 @@ void stripLineInvisibleChars(std::string &str) } -std::tm localtime_r(const time_t& time) +struct tm* localtime_r(const time_t* time, struct tm *result) { - std::tm tm_snapshot; #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) - localtime_s(&tm_snapshot, &time); + localtime_s(result, time); + return result; #else - localtime_r(&time, &tm_snapshot); // POSIX + return localtime_r(&time, &result); // POSIX #endif - return tm_snapshot; } @@ -239,7 +238,8 @@ uint32 TimeStringToSecs(const std::string& timestring) std::string TimeToTimestampStr(time_t t) { - tm aTm = localtime_r(t); + tm aTm; + localtime_r(&t, &aTm); // YYYY year // MM month (2 digits 01-12) // DD day (2 digits 01-31) |