diff --git a/src/RFID.cpp b/src/RFID.cpp index 6ec59e2..6af3b54 100644 --- a/src/RFID.cpp +++ b/src/RFID.cpp @@ -161,7 +161,8 @@ bool RFID::writeBlock(MFRC522Constants::Uid &uidToRead, byte blockAddr, uint8_t return false; } - byte size = sizeof(comData); + // Take into account the two bytes used only for the read commands. + byte size = sizeof(comData) - 2; for (byte& bufferByte: comData) bufferByte = 0;