summaryrefslogtreecommitdiffstats
path: root/src/ipsw.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-09-27 17:10:13 +0200
committerGravatar Nikias Bassen2013-09-27 17:10:13 +0200
commitb2619fbc52e9728c57c4ad6f9579327abb0bbc51 (patch)
tree955f7af8b927c6180dc92a0006f4545880fcf444 /src/ipsw.c
parent6cbdeea4dc871165f90b511ca6b81eb7139709b3 (diff)
downloadidevicerestore-b2619fbc52e9728c57c4ad6f9579327abb0bbc51.tar.gz
idevicerestore-b2619fbc52e9728c57c4ad6f9579327abb0bbc51.tar.bz2
ipsw: also check product type in ipsw_get_latest_fw to get largest major version
Diffstat (limited to 'src/ipsw.c')
-rw-r--r--src/ipsw.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index 3abda03..4f86baa 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -296,9 +296,12 @@ int ipsw_get_latest_fw(plist_t version_data, const char* product, char** fwurl,
do {
plist_dict_next_item(n1, iter, &key, &val);
if (key) {
- long long unsigned int v = strtoull(key, NULL, 10);
- if (v > major)
- major = v;
+ plist_t pr = plist_access_path(n1, 3, key, "MobileDeviceSoftwareVersions", product);
+ if (pr) {
+ long long unsigned int v = strtoull(key, NULL, 10);
+ if (v > major)
+ major = v;
+ }
free(key);
}
} while (val);