diff options
author | Nikias Bassen | 2013-01-24 01:48:23 +0100 |
---|---|---|
committer | Nikias Bassen | 2013-01-24 01:48:23 +0100 |
commit | cce3cca8d31e0f7a9e8609b02bab6ab93eac0fb3 (patch) | |
tree | 6c24c5d86d2434305b2c599f0015be013983ab27 | |
parent | d61d30ab8edafb8cbac3eaa1935abdd2257eeaee (diff) | |
download | libimobiledevice-cce3cca8d31e0f7a9e8609b02bab6ab93eac0fb3.tar.gz libimobiledevice-cce3cca8d31e0f7a9e8609b02bab6ab93eac0fb3.tar.bz2 |
idevicebackup2: make sure -1 is returned if invalid arguments are passed
-rw-r--r-- | tools/idevicebackup2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c index bcaad5c..b850329 100644 --- a/tools/idevicebackup2.c +++ b/tools/idevicebackup2.c @@ -1312,7 +1312,7 @@ int main(int argc, char *argv[]) i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); - return 0; + return -1; } udid = strdup(argv[i]); continue; @@ -1321,7 +1321,7 @@ int main(int argc, char *argv[]) i++; if (!argv[i] || (strlen(argv[i]) != 40)) { print_usage(argc, argv); - return 0; + return -1; } source_udid = strdup(argv[i]); continue; @@ -1355,7 +1355,7 @@ int main(int argc, char *argv[]) i++; if (!argv[i]) { print_usage(argc, argv); - return 0; + return -1; } if (backup_password) free(backup_password); @@ -1379,7 +1379,7 @@ int main(int argc, char *argv[]) if (!argv[i]) { printf("No argument given for encryption command; requires either 'on' or 'off'.\n"); print_usage(argc, argv); - return 0; + return -1; } if (!strcmp(argv[i], "on")) { cmd_flags |= CMD_FLAG_ENCRYPTION_ENABLE; @@ -1426,7 +1426,7 @@ int main(int argc, char *argv[]) if (!argv[i]) { printf("Old and new passwords have to be passed as arguments for the changepw command\n"); print_usage(argc, argv); - return 0; + return -1; } newpw = strdup(argv[i]); } @@ -1437,7 +1437,7 @@ int main(int argc, char *argv[]) } else { print_usage(argc, argv); - return 0; + return -1; } } |