chg: 'hf mf restore' - add finish message

chg: 'hf mfu restore' - add finish message
chg: 'hf 15 restore' - add finish message,  close filehandle when failing.
This commit is contained in:
iceman1001 2019-04-03 15:34:36 +02:00
commit 0383d7f052
3 changed files with 9 additions and 2 deletions

View file

@ -847,6 +847,8 @@ int CmdHF15Restore(const char *Cmd) {
return 3; return 3;
} }
PrintAndLogEx(INFO, "Restoring data blocks.");
while (1) { while (1) {
tried = 0; tried = 0;
hex[0] = 0x00; hex[0] = 0x00;
@ -877,12 +879,16 @@ int CmdHF15Restore(const char *Cmd) {
for (tried = 0; tried < retries; tried++) for (tried = 0; tried < retries; tried++)
if (!(retval = CmdHF15Write(tmpCmd))) if (!(retval = CmdHF15Write(tmpCmd)))
break; break;
if (tried >= retries) if (tried >= retries) {
fclose(f);
return retval; return retval;
}
i++; i++;
} }
fclose(f); fclose(f);
PrintAndLogEx(INFO, "Finish restore");
return 0;
} }
int CmdHF15List(const char *Cmd) { int CmdHF15List(const char *Cmd) {

View file

@ -1055,8 +1055,8 @@ int CmdHF14AMfRestore(const char *Cmd) {
} }
} }
} }
fclose(fdump); fclose(fdump);
PrintAndLogEx(INFO, "Finish restore");
return 0; return 0;
} }

View file

@ -2223,6 +2223,7 @@ int CmdHF14AMfURestore(const char *Cmd) {
DropField(); DropField();
free(dump); free(dump);
PrintAndLogEx(INFO, "Finish restore");
return 0; return 0;
} }
// //