fixed showing error

This commit is contained in:
merlokk 2018-10-19 15:30:28 +03:00
commit be34bb6fa4

View file

@ -750,6 +750,11 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
recv = resp.d.asBytes; recv = resp.d.asBytes;
int iLen = resp.arg[0]; int iLen = resp.arg[0];
if(!iLen) {
PrintAndLog("14aRAW ERROR: No card response.");
return 1;
}
*dataoutlen = iLen - 2; *dataoutlen = iLen - 2;
if (*dataoutlen < 0) if (*dataoutlen < 0)
*dataoutlen = 0; *dataoutlen = 0;
@ -766,11 +771,6 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
memcpy(dataout, &recv[2], *dataoutlen); memcpy(dataout, &recv[2], *dataoutlen);
if(!iLen) {
PrintAndLog("14aRAW ERROR: No card response.");
return 1;
}
// CRC Check // CRC Check
if (iLen == -1) { if (iLen == -1) {
PrintAndLog("14aRAW ERROR: ISO 14443A CRC error."); PrintAndLog("14aRAW ERROR: ISO 14443A CRC error.");