Chg: 'data ndef' - cleaner output if called with no hex

This commit is contained in:
iceman1001 2020-04-01 09:26:39 +02:00
parent 83e92c6455
commit d633340a1a

View file

@ -2309,8 +2309,9 @@ static int CmdDataNDEF(const char *Cmd) {
int datalen = 0; int datalen = 0;
uint8_t data[MAX_NDEF_LEN] = {0}; uint8_t data[MAX_NDEF_LEN] = {0};
CLIGetHexWithReturn(1, data, &datalen); CLIGetHexWithReturn(1, data, &datalen);
CLIParserFree(); CLIParserFree();
if (datalen == 0)
return PM3_EINVARG;
PrintAndLogEx(INFO, "Parsed NDEF Records"); PrintAndLogEx(INFO, "Parsed NDEF Records");
return NDEFRecordsDecodeAndPrint(data, datalen); return NDEFRecordsDecodeAndPrint(data, datalen);