summaryrefslogtreecommitdiff
path: root/phone-app/src/Logs
diff options
context:
space:
mode:
Diffstat (limited to 'phone-app/src/Logs')
-rw-r--r--phone-app/src/Logs/Model/DateGroupProvider.cpp3
-rw-r--r--phone-app/src/Logs/Utils.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/phone-app/src/Logs/Model/DateGroupProvider.cpp b/phone-app/src/Logs/Model/DateGroupProvider.cpp
index 076d1ff..51d40ac 100644
--- a/phone-app/src/Logs/Model/DateGroupProvider.cpp
+++ b/phone-app/src/Logs/Model/DateGroupProvider.cpp
@@ -30,7 +30,8 @@ template <typename MemberType>
Group *DateGroupProvider<MemberType>::createGroup(DataItem &dataItem)
{
time_t logTime = static_cast<MemberType &>(dataItem).getTime();
- return new DateGroup(removeTime(*localtime(&logTime)));
+ struct tm tm_buf;
+ return new DateGroup(removeTime(*localtime_r(&logTime, &tm_buf)));
}
template <typename MemberType>
diff --git a/phone-app/src/Logs/Utils.cpp b/phone-app/src/Logs/Utils.cpp
index d57adec..6dabafa 100644
--- a/phone-app/src/Logs/Utils.cpp
+++ b/phone-app/src/Logs/Utils.cpp
@@ -54,7 +54,8 @@ std::string Logs::formatDate(time_t date)
std::string Logs::formatDuration(time_t duration)
{
char buffer[BUFFER_SIZE];
- strftime(buffer, sizeof(buffer), duration > ONE_HOUR ? "%H:%M:%S" : "%M:%S", gmtime(&duration));
+ struct tm tmp;
+ strftime(buffer, sizeof(buffer), duration > ONE_HOUR ? "%H:%M:%S" : "%M:%S", gmtime_r(&duration, &tmp));
return buffer;
}