summaryrefslogtreecommitdiffstats
path: root/tools/irecovery.c
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2013-09-26 23:02:57 +0200
committerGravatar Martin Szulecki2013-09-26 23:02:57 +0200
commit043bf24ab5332bc9a4fee04a102ef876f45981ac (patch)
tree64886fd5c82d276db01255341b0a50b8fed50cc4 /tools/irecovery.c
parentad7ae3c8db91f2a33bba5615cf1b1a9035f7917a (diff)
downloadlibirecovery-043bf24ab5332bc9a4fee04a102ef876f45981ac.tar.gz
libirecovery-043bf24ab5332bc9a4fee04a102ef876f45981ac.tar.bz2
irecovery: Fix code style for if-else in argument parsing code
Diffstat (limited to 'tools/irecovery.c')
-rw-r--r--tools/irecovery.c31
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);
}