mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-07-21 11:11:49 +00:00
Fix returned value ((res=f()<0)) => ((res=f())<0); this solves a bug in nfc-relay-picc
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user