From 742194896d11ea2f49458e225bb82a2f432bb26c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 6 Jul 2022 12:21:14 +0200 Subject: [PATCH] fix cid 395629 - simpler logic --- client/src/proxmark3.c | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 2e176335f..9ca38a2a1 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -699,34 +699,18 @@ finish2: } static int reboot_bootloader_pm3(char *serial_port_name) { - - int ret = PM3_EUNDEF; - if (serial_port_name == NULL) { PrintAndLogEx(ERR, "You must specify a port.\n"); return PM3_EINVARG; } - if (OpenProxmark(&g_session.current_device, serial_port_name, true, 60, true, FLASHMODE_SPEED)) { - PrintAndLogEx(NORMAL, _GREEN_(" found")); - } else { + if (OpenProxmark(&g_session.current_device, serial_port_name, true, 60, true, FLASHMODE_SPEED) == false) { PrintAndLogEx(ERR, "Could not find Proxmark3 on " _RED_("%s") ".\n", serial_port_name); - ret = PM3_ETIMEOUT; - goto finish2; + return PM3_ETIMEOUT; } - ret = flash_reboot_bootloader(serial_port_name); - return ret; - -finish2: - if (ret == PM3_SUCCESS) - PrintAndLogEx(SUCCESS, _CYAN_("All done")); - else if (ret == PM3_EOPABORTED) - PrintAndLogEx(FAILED, "Aborted by user"); - else - PrintAndLogEx(ERR, "Aborted on error"); - PrintAndLogEx(INFO, "\nHave a nice day!"); - return ret; + PrintAndLogEx(NORMAL, _GREEN_(" found")); + return flash_reboot_bootloader(serial_port_name); } #endif //LIBPM3