summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2021-06-21 22:08:36 +0200
committerGravatar Nikias Bassen2021-06-21 22:08:36 +0200
commit0d18d28d31822ec82a04bbee79497d0d18b5af89 (patch)
tree4bdda261df35a0ebbe3af9ece71eade0f1ad4aac
parentb2582f5a89dd979640cc83f6404270f380ad0f58 (diff)
downloadlibimobiledevice-glue-0d18d28d31822ec82a04bbee79497d0d18b5af89.tar.gz
libimobiledevice-glue-0d18d28d31822ec82a04bbee79497d0d18b5af89.tar.bz2
utils: Make sure to add MAC_EPOCH when printing PLIST_DATE nodes
-rw-r--r--src/utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c
index fa692a0..c25ebe1 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -38,6 +38,8 @@
#include "common.h"
#include "libimobiledevice-glue/utils.h"
+#define MAC_EPOCH 978307200
+
#ifndef HAVE_STPCPY
#undef stpcpy
char *stpcpy(char *s1, const char *s2);
@@ -496,7 +498,7 @@ static void plist_node_print_to_stream(plist_t node, int* indent_level, FILE* st
case PLIST_DATE:
plist_get_date_val(node, (int32_t*)&tv.tv_sec, (int32_t*)&tv.tv_usec);
{
- time_t ti = (time_t)tv.tv_sec;
+ time_t ti = (time_t)tv.tv_sec + MAC_EPOCH;
struct tm *btime = localtime(&ti);
if (btime) {
s = (char*)malloc(24);