From 0d18d28d31822ec82a04bbee79497d0d18b5af89 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 21 Jun 2021 22:08:36 +0200 Subject: utils: Make sure to add MAC_EPOCH when printing PLIST_DATE nodes --- src/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); -- cgit v1.1-32-gdbae