From 9df6fa8e8e1382c592e74683567dd1517bd74368 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 16 Jan 2020 00:26:15 +0100 Subject: [PATCH] hitag: stop detecting if response header is corrupted --- armsrc/hitag2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index 3920d0010..4387f109f 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -1528,11 +1528,14 @@ void ReaderHitag(hitag_function htf, hitag_data *htd) { //Dbprintf("Detected unexpected number of manchester decoded samples [%d]", nrzs); break; } else { - for (size_t i = 0; i < 5; i++) { + size_t i; + for (i = 0; i < 5; i++) { if (nrz_samples[i] != 1) { - Dbprintf("Detected incorrect header, the bit [%d] is zero instead of one", i); + Dbprintf("Detected incorrect header, the bit [%d] is zero instead of one, abort", i); + break; } } + if (i < 5) break; } // Pack the response into a byte array