diff options
Diffstat (limited to '')
-rw-r--r-- | src/base/database.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/base/database.cpp b/src/base/database.cpp index 0e1ba92d..8ff34a67 100644 --- a/src/base/database.cpp +++ b/src/base/database.cpp @@ -325,9 +325,10 @@ namespace usdx char* StatDatabase::format_date(char* time, size_t max, time_t timestamp) { if (timestamp != 0) { - struct tm *tmp = localtime(×tamp); - if (tmp) { - strftime(time, max, "%d.%m.%y" /* TODO: Language.Translate("STAT_FORMAT_DATE")*/, tmp); + struct tm tmp; + + if (localtime_r(×tamp, &tmp)) { + strftime(time, max, "%d.%m.%y" /* TODO: Language.Translate("STAT_FORMAT_DATE")*/, &tmp); return time; } } |