Fix comparison when nfc_initiator_target_is_present() with a specified target

This commit is contained in:
Romuald Conty 2015-05-18 20:14:18 +02:00
parent 22078a8509
commit d028bc725d

View file

@ -1059,6 +1059,7 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
size_t szTargetsData = sizeof(abtTargetsData);
int res = 0;
nfc_target nttmp;
memset(&nttmp, 0x00, sizeof(nfc_target));
if (nm.nmt == NMT_ISO14443BI || nm.nmt == NMT_ISO14443B2SR || nm.nmt == NMT_ISO14443B2CT) {
if (CHIP_DATA(pnd)->type == RCS360) {
@ -1148,7 +1149,6 @@ pn53x_initiator_select_passive_target_ext(struct nfc_device *pnd,
if (! found)
return 0;
} else {
const pn53x_modulation pm = pn53x_nm_to_pm(nm);
if ((PM_UNDEFINED == pm) || (NBR_UNDEFINED == nm.nbr)) {
pnd->last_error = NFC_EINVARG;
@ -1221,6 +1221,8 @@ pn53x_initiator_poll_target(struct nfc_device *pnd,
szTargetTypes++;
}
nfc_target ntTargets[2];
memset(ntTargets, 0x00, sizeof(nfc_target) * 2);
if ((res = pn53x_InAutoPoll(pnd, apttTargetTypes, szTargetTypes, uiPollNr, uiPeriod, ntTargets, 0)) < 0)
return res;
switch (res) {