Update cmdhf14a.c

Signed-off-by: 歐歪 <brian20020925@gmail.com>
This commit is contained in:
歐歪 authored and GitHub committed 2026-08-30 03:46:41 +08:00
1 parent 710df522fe
commit 910f6ba41f
1 file changed
+1 -6
+1 -6
View File
@@ -4300,12 +4300,7 @@ int CmdHF14ANdefWrite(const char *Cmd) {
}
uint8_t tmp_raw[256];
memcpy(tmp_raw, raw, sizeof(tmp_raw));
// A NFC Type 4 Tag NDEF file starts with the NLEN field, a two byte
// big endian length of the NDEF message that follows. It is not a
// TLV container, so there is no 0x03 tag byte here.
// raw[] is 256 bytes and the bounds check above caps bytes at 254,
// hence the high byte of NLEN is always zero.
raw[0] = 0x00;
raw[0] = 0x00; // the high byte of NLEN is always zero.
raw[1] = bytes;
memcpy(raw + 2, tmp_raw, sizeof(raw) - 2);
bytes += 2;