summaryrefslogtreecommitdiffstats
path: root/src/idevicerestore.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2019-03-22 00:25:05 +0100
committerGravatar Nikias Bassen2019-03-22 00:25:05 +0100
commite0cef46e9c0fe6f4d45ac19a2ddaa74a33a5570e (patch)
treed83c3f252cc4e6a45081be1116a867cbd1e3d390 /src/idevicerestore.c
parent8a882038b2b1e022fbd19eaf8bea51006a373c06 (diff)
downloadidevicerestore-e0cef46e9c0fe6f4d45ac19a2ddaa74a33a5570e.tar.gz
idevicerestore-e0cef46e9c0fe6f4d45ac19a2ddaa74a33a5570e.tar.bz2
Make sure user input can be cancelled properly
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r--src/idevicerestore.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c
index f3e9160..ca6f232 100644
--- a/src/idevicerestore.c
+++ b/src/idevicerestore.c
@@ -371,6 +371,10 @@ int idevicerestore_start(struct idevicerestore_client_t* client)
fflush(stdout);
fflush(stdin);
get_user_input(input, 63, 0);
+ if (*input == '\0') {
+ plist_free(signed_fws);
+ return -1;
+ }
unsigned long selected = strtoul(input, NULL, 10);
if (selected == 0 || selected > count) {
printf("Invalid input value. Must be in range: 1..%d\n", count);