Skip to content

Commit

Permalink
Tidier fix for incorrect block write/count as per @doegox
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Laurie committed Feb 19, 2017
1 parent 84c3e8a commit e119296
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/nfc-mfultralight.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ write_card(bool write_otp, bool write_lock, bool write_uid)
}
}

for (uint32_t page = uiSkippedPages; page <= (((uiBlocks + 1) / 4) * 4); page++) {
for (uint32_t page = uiSkippedPages; page <= uiBlocks; page++) {
if ((page == 0x2) && (!write_lock)) {
printf("s");
uiSkippedPages++;
Expand Down Expand Up @@ -309,7 +309,7 @@ write_card(bool write_otp, bool write_lock, bool write_uid)
print_success_or_failure(bFailure, &uiWritenPages);
}
printf("|\n");
printf("Done, %d of %d pages written (%d pages skipped).\n", uiWritenPages - 1, uiBlocks + 1, uiSkippedPages);
printf("Done, %d of %d pages written (%d pages skipped).\n", uiWritenPages, uiBlocks + 1, uiSkippedPages);

return true;
}
Expand Down

0 comments on commit e119296

Please sign in to comment.