diff options
author | Martin Szulecki | 2013-09-26 23:02:57 +0200 |
---|---|---|
committer | Martin Szulecki | 2013-09-26 23:02:57 +0200 |
commit | 043bf24ab5332bc9a4fee04a102ef876f45981ac (patch) | |
tree | 64886fd5c82d276db01255341b0a50b8fed50cc4 | |
parent | ad7ae3c8db91f2a33bba5615cf1b1a9035f7917a (diff) | |
download | libirecovery-043bf24ab5332bc9a4fee04a102ef876f45981ac.tar.gz libirecovery-043bf24ab5332bc9a4fee04a102ef876f45981ac.tar.bz2 |
irecovery: Fix code style for if-else in argument parsing code
-rw-r--r-- | tools/irecovery.c | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/tools/irecovery.c b/tools/irecovery.c index a46d5df..912ac37 100644 --- a/tools/irecovery.c +++ b/tools/irecovery.c @@ -68,21 +68,15 @@ static void parse_command(irecv_client_t client, unsigned char* command, unsigne debug("Executing %s\n", action); if (!strcmp(cmd, "/exit")) { quit = 1; - } else - - if (!strcmp(cmd, "/help")) { + } else if (!strcmp(cmd, "/help")) { shell_usage(); - } else - - if (!strcmp(cmd, "/upload")) { + } else if (!strcmp(cmd, "/upload")) { char* filename = strtok(NULL, " "); debug("Uploading files %s\n", filename); if (filename != NULL) { irecv_send_file(client, filename, 0); } - } else - - if (!strcmp(cmd, "/deviceinfo")) { + } else if (!strcmp(cmd, "/deviceinfo")) { int ret; unsigned int cpid, bdid; unsigned long long ecid; @@ -112,25 +106,20 @@ static void parse_command(irecv_client_t client, unsigned char* command, unsigne if(ret == IRECV_E_SUCCESS) { printf("IMEI: %s\n", imei); } - } else - - if (!strcmp(cmd, "/exploit")) { + } else if (!strcmp(cmd, "/exploit")) { char* filename = strtok(NULL, " "); debug("Sending exploit %s\n", filename); if (filename != NULL) { irecv_send_file(client, filename, 0); } irecv_send_exploit(client); - } else - - if (!strcmp(cmd, "/execute")) { - char* filename = strtok(NULL, " "); - debug("Executing script %s\n", filename); - if (filename != NULL) { - irecv_execute_script(client, filename); - } + } else if (!strcmp(cmd, "/execute")) { + char* filename = strtok(NULL, " "); + debug("Executing script %s\n", filename); + if (filename != NULL) { + irecv_execute_script(client, filename); } - + } free(action); } |