From c03e425550ba7c88d773ddd91670d52e7792ab55 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 3 Apr 2019 15:42:42 +0200 Subject: [PATCH] chg: 'hf 15 restore' - fail message added --- client/cmdhf15.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/cmdhf15.c b/client/cmdhf15.c index f9fe0be2a..55e4aa478 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -876,11 +876,14 @@ int CmdHF15Restore(const char *Cmd) { snprintf(tmpCmd, sizeof(tmpCmd), "%s u %u %s", newCmdPrefix, i, hex); PrintAndLogEx(DEBUG, "Command to be sent| %s", tmpCmd); - for (tried = 0; tried < retries; tried++) - if (!(retval = CmdHF15Write(tmpCmd))) + for (tried = 0; tried < retries; tried++) { + if (!(retval = CmdHF15Write(tmpCmd))) { break; + } + } if (tried >= retries) { fclose(f); + PrintAndLogEx(FAILED, "Restore failed. Too many retries."); return retval; }