From f4b75d7f5b8485e6eafcfbd510974c54b4e8b69e Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 29 Apr 2019 14:42:37 +0200 Subject: [PATCH] fix: ndef parse uri off by one --- client/mifare/ndef.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/mifare/ndef.c b/client/mifare/ndef.c index d44991c0e..df4741dbc 100644 --- a/client/mifare/ndef.c +++ b/client/mifare/ndef.c @@ -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; }