From 3ea2cb0eda4ce4df2f1828ae83e99c8dbab38255 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 3 Apr 2024 17:14:44 +0200 Subject: [PATCH] faster return --- armsrc/BigBuf.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/armsrc/BigBuf.c b/armsrc/BigBuf.c index e45993e73..27ed42f62 100644 --- a/armsrc/BigBuf.c +++ b/armsrc/BigBuf.c @@ -308,6 +308,11 @@ bool LogTrace_ISO15693(const uint8_t *bytes, uint16_t len, uint32_t ts_start, ui // specific LogTrace function for bitstreams: the partial byte size is stored in first parity byte. E.g. bitstream "1100 00100010" -> partial byte: 4 bits bool RAMFUNC LogTraceBits(const uint8_t *btBytes, uint16_t bitLen, uint32_t timestamp_start, uint32_t timestamp_end, bool reader2tag) { + + if ( bitLen == 0 ) { + return false; + } + uint8_t parity[(nbytes(bitLen) - 1) / 8 + 1]; memset(parity, 0x00, sizeof(parity)); // parity has amount of leftover bits.