Fix returned value ((res=f()<0)) => ((res=f())<0); this solves a bug in nfc-relay-picc
This commit is contained in:
parent
0ac3b26982
commit
5876e33e49
4 changed files with 11 additions and 11 deletions
|
|
@ -1087,7 +1087,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
|
|||
if (szTargetsData != 2)
|
||||
return 0; // Target is not ISO14443B2CT
|
||||
uint8_t abtRead[] = { 0xC4 }; // Reading UID_MSB (Read address 4)
|
||||
if ((res = pn53x_initiator_transceive_bytes(pnd, abtRead, sizeof(abtRead), abtTargetsData + 4, sizeof(abtTargetsData) - 4, timeout) < 0)) {
|
||||
if ((res = pn53x_initiator_transceive_bytes(pnd, abtRead, sizeof(abtRead), abtTargetsData + 4, sizeof(abtTargetsData) - 4, timeout)) < 0) {
|
||||
return res;
|
||||
}
|
||||
szTargetsData = 6; // u16 UID_LSB, u8 prod code, u8 fab code, u16 UID_MSB
|
||||
|
|
@ -1125,7 +1125,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
|
|||
if (pnt) {
|
||||
pnt->nm = nm;
|
||||
// Fill the tag info struct with the values corresponding to this init modulation
|
||||
if ((res = pn53x_decode_target_data(abtTargetsData + 1, szTargetsData - 1, CHIP_DATA(pnd)->type, nm.nmt, &(pnt->nti)) < 0)) {
|
||||
if ((res = pn53x_decode_target_data(abtTargetsData + 1, szTargetsData - 1, CHIP_DATA(pnd)->type, nm.nmt, &(pnt->nti))) < 0) {
|
||||
return res;
|
||||
}
|
||||
pn53x_current_target_new(pnd, pnt);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue