aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base/database.cpp7
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(&timestamp);
- if (tmp) {
- strftime(time, max, "%d.%m.%y" /* TODO: Language.Translate("STAT_FORMAT_DATE")*/, tmp);
+ struct tm tmp;
+
+ if (localtime_r(&timestamp, &tmp)) {
+ strftime(time, max, "%d.%m.%y" /* TODO: Language.Translate("STAT_FORMAT_DATE")*/, &tmp);
return time;
}
}