From f237d443391bbc1c74d67aab87e351b32508bdb2 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Wed, 11 Aug 2010 09:26:22 +0000 Subject: [PATCH] Take care of 16-blocks-long sectors of Mifare Classic 4K in the nfc-mfclassic example's blocks counting routine. --- examples/nfc-mfclassic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/nfc-mfclassic.c b/examples/nfc-mfclassic.c index 0efdbbe..58855be 100644 --- a/examples/nfc-mfclassic.c +++ b/examples/nfc-mfclassic.c @@ -65,8 +65,8 @@ static void print_success_or_failure (bool bFailure, uint32_t * uiBlockCounter) { printf ("%c", (bFailure) ? 'x' : '.'); - if (uiBlockCounter) - *uiBlockCounter += (bFailure) ? 0 : 4; + if (uiBlockCounter && !bFailure) + *uiBlockCounter += (*uiBlockCounter < 128) ? 4 : 16; } static bool