Skip to content

Commit

Permalink
Fixed warning : ordered comparison of pointer with integer zero (issue
Browse files Browse the repository at this point in the history
  • Loading branch information
leopold-gravier committed Mar 25, 2024
1 parent 13eaed7 commit 8a316a7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/MFRC522Extended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,10 @@ MFRC522::StatusCode MFRC522Extended::TCL_Transceive(TagInfo *tag, byte *sendData
PcbBlock in;
byte outBuffer[FIFO_SIZE];
byte outBufferSize = FIFO_SIZE;
byte totalBackLen = *backLen;
byte totalBackLen = 0;
if (backLen) {
totalBackLen = *backLen;
}

// This command sends an I-Block
out.prologue.pcb = 0x02;
Expand Down Expand Up @@ -821,7 +824,7 @@ MFRC522::StatusCode MFRC522Extended::TCL_Transceive(TagInfo *tag, byte *sendData
// Swap block number on success
tag->blockNumber = !tag->blockNumber;

if (backData && (backLen > 0)) {
if (backData && backLen) {
if (*backLen < in.inf.size)
return STATUS_NO_ROOM;

Expand All @@ -844,7 +847,7 @@ MFRC522::StatusCode MFRC522Extended::TCL_Transceive(TagInfo *tag, byte *sendData
if (result != STATUS_OK)
return result;

if (backData && (backLen > 0)) {
if (backData && backLen) {
if ((*backLen + ackDataSize) > totalBackLen)
return STATUS_NO_ROOM;

Expand Down

0 comments on commit 8a316a7

Please sign in to comment.