diff options
author | Nikias Bassen | 2021-06-21 22:08:36 +0200 |
---|---|---|
committer | Nikias Bassen | 2021-06-21 22:08:36 +0200 |
commit | 0d18d28d31822ec82a04bbee79497d0d18b5af89 (patch) | |
tree | 4bdda261df35a0ebbe3af9ece71eade0f1ad4aac /src/utils.c | |
parent | b2582f5a89dd979640cc83f6404270f380ad0f58 (diff) | |
download | libimobiledevice-glue-0d18d28d31822ec82a04bbee79497d0d18b5af89.tar.gz libimobiledevice-glue-0d18d28d31822ec82a04bbee79497d0d18b5af89.tar.bz2 |
utils: Make sure to add MAC_EPOCH when printing PLIST_DATE nodes
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 4 |
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); |