Skip to content

Commit

Permalink
fix ISSUE-371: do not compare backLen > 0
Browse files Browse the repository at this point in the history
Instead we just look if backLen is set. 
More infos here: miguelbalboa#371
  • Loading branch information
FallenAngel666 authored Mar 1, 2022
1 parent eda2e38 commit cd53f8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MFRC522Extended.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,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 +844,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

1 comment on commit cd53f8a

@oxg4113
Copy link

@oxg4113 oxg4113 commented on cd53f8a Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you so much, already solve my problem

Please sign in to comment.