summaryrefslogtreecommitdiffstats
path: root/tools/idevicedate.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2012-11-08 22:05:17 +0100
committerGravatar Nikias Bassen2012-11-08 22:05:17 +0100
commit3a1eac8b5da6b44149d08b1aa6ac802a71ec518f (patch)
tree323e94ca19ab19f9191968f6f4787a85afeb281c /tools/idevicedate.c
parent6fdf7932c946d48157929b37b2956cae19d80ac4 (diff)
downloadlibimobiledevice-3a1eac8b5da6b44149d08b1aa6ac802a71ec518f.tar.gz
libimobiledevice-3a1eac8b5da6b44149d08b1aa6ac802a71ec518f.tar.bz2
idevicedate: fix time retrieval for iOS6+
Diffstat (limited to 'tools/idevicedate.c')
-rw-r--r--tools/idevicedate.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/tools/idevicedate.c b/tools/idevicedate.c
index 0f1410f..9de6ed0 100644
--- a/tools/idevicedate.c
+++ b/tools/idevicedate.c
@@ -150,7 +150,21 @@ int main(int argc, char *argv[])
/* get time value from device */
if(lockdownd_get_value(client, NULL, "TimeIntervalSince1970", &node) == LOCKDOWN_E_SUCCESS) {
if (node) {
- plist_get_uint_val(node, &datetime);
+ switch (plist_get_node_type(node)) {
+ case PLIST_UINT:
+ plist_get_uint_val(node, &datetime);
+ break;
+ case PLIST_REAL:
+ {
+ double rv = 0;
+ plist_get_real_val(node, &rv);
+ datetime = rv;
+ }
+ break;
+ default:
+ fprintf(stderr, "Unexpected node type for 'TimeIntervalSince1970'\n");
+ break;
+ }
plist_free(node);
node = NULL;