From 8c76e12fec68e79875e99b24b2cd88904def6b14 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Mon, 24 Mar 2025 11:33:20 +0100 Subject: [PATCH] cppcheck identicalInnerCondition --- client/src/cmdlfem4x70.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/cmdlfem4x70.c b/client/src/cmdlfem4x70.c index be3dbe11a..6c58b9c86 100644 --- a/client/src/cmdlfem4x70.c +++ b/client/src/cmdlfem4x70.c @@ -1226,7 +1226,7 @@ static int CmdEM4x70AutoRecover(const char *Cmd) { // lf em 4x70 write -b N -d 0000 // lf em 4x70 brute -b N --rnd --frn // lf em 4x70 write -b N -d - for (uint8_t block = 9; (PM3_SUCCESS == result) && (block > 6); --block) { + for (uint8_t block = 9; block > 6; --block) { uint8_t step = block == 9 ? 2 : block == 8 ? 3 : @@ -1324,6 +1324,8 @@ static int CmdEM4x70AutoRecover(const char *Cmd) { if (PM3_SUCCESS == result) { last_successful_step = step; + } else { + break; } } // The good news is that, if the above succeeded, then from this point forward, the tag remains in a known-good state.