From 043bf24ab5332bc9a4fee04a102ef876f45981ac Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Thu, 26 Sep 2013 23:02:57 +0200 Subject: irecovery: Fix code style for if-else in argument parsing code --- tools/irecovery.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) (limited to 'tools') 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); } -- cgit v1.1-32-gdbae