aboutsummaryrefslogtreecommitdiff
path: root/src/Body.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Body.cpp')
-rw-r--r--src/Body.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Body.cpp b/src/Body.cpp
index a84256e..aa8d1d6 100644
--- a/src/Body.cpp
+++ b/src/Body.cpp
@@ -844,7 +844,8 @@ namespace QuickMedia {
//struct tm *now_tm = localtime(&time_now);
time_t message_timestamp = body_item->get_timestamp() / 1000;
- struct tm *message_tm = localtime(&message_timestamp);
+ struct tm message_tm;
+ localtime_r(&message_timestamp, &message_tm);
//bool is_same_year = message_tm->tm_year == now_tm->tm_year;
@@ -855,7 +856,7 @@ namespace QuickMedia {
else
strftime(time_str, sizeof(time_str) - 1, "%a %b %d %H:%M:%S %Y", message_tm);
*/
- strftime(time_str, sizeof(time_str) - 1, "%a %b %d %H:%M", message_tm);
+ strftime(time_str, sizeof(time_str) - 1, "%a %b %d %H:%M", &message_tm);
if(body_item->timestamp_text)
body_item->timestamp_text->setString(time_str);