From cbb976e320e81012716781837244dc186774e972 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Sun, 16 Jan 2022 19:41:09 +0100 Subject: [PATCH] No error code on regular exit --- client/src/cmdmain.c | 2 +- client/src/proxmark3.c | 5 +++++ include/pm3_cmd.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/cmdmain.c b/client/src/cmdmain.c index b314f25fd..beafe21b6 100644 --- a/client/src/cmdmain.c +++ b/client/src/cmdmain.c @@ -282,7 +282,7 @@ static int CmdQuit(const char *Cmd) { }; CLIExecWithReturn(ctx, Cmd, argtable, true); CLIParserFree(ctx); - return PM3_EFATAL; + return PM3_SQUIT; } static int CmdRev(const char *Cmd) { diff --git a/client/src/proxmark3.c b/client/src/proxmark3.c index 18eba4a2d..a7cc7f446 100644 --- a/client/src/proxmark3.c +++ b/client/src/proxmark3.c @@ -407,6 +407,11 @@ check_script: // exit or quit if (mainret == PM3_EFATAL) break; + if (mainret == PM3_SQUIT) { + // Normal quit, map to 0 + mainret = PM3_SUCCESS; + break; + } } free(cmd); cmd = NULL; diff --git a/include/pm3_cmd.h b/include/pm3_cmd.h index 3505c9ae7..94eb4d9c0 100644 --- a/include/pm3_cmd.h +++ b/include/pm3_cmd.h @@ -706,6 +706,8 @@ typedef struct { // Error codes Usages: +// Success, regular quit +#define PM3_SQUIT 2 // Success, transfer nonces pm3: Sending nonces back to client #define PM3_SNONCES 1 // Success (no error)