fix: ndef parse uri off by one

This commit is contained in:
iceman1001 2019-04-29 14:42:37 +02:00
parent 67e3ac3f54
commit f4b75d7f5b

View file

@ -225,7 +225,12 @@ static int ndefDecodePayload(NDEFHeader_t *ndef) {
}
if (!strncmp((char *)ndef->Type, "U", ndef->TypeLen)) {
PrintAndLogEx(NORMAL, "\turi : %s%.*s", (ndef->Payload[0] <= 0x23 ? URI_s[ndef->Payload[0]] : "[err]"), ndef->PayloadLen, &ndef->Payload[1]);
PrintAndLogEx(NORMAL
, "\turi : %s%.*s"
, (ndef->Payload[0] <= 0x23 ? URI_s[ndef->Payload[0]] : "[err]")
, ndef->PayloadLen-1
, &ndef->Payload[1]
);
}
if (!strncmp((char *)ndef->Type, "Sig", ndef->TypeLen)) {
@ -353,6 +358,5 @@ int NDEFDecodeAndPrint(uint8_t *ndef, size_t ndefLen, bool verbose) {
}
}
}
return 0;
}