Skip to content

Commit

Permalink
Fix comparison when nfc_initiator_target_is_present() with a specifie…
Browse files Browse the repository at this point in the history
…d target
  • Loading branch information
neomilium committed May 18, 2015
1 parent 22078a8 commit d028bc7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libnfc/chips/pn53x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit d028bc7

Please sign in to comment.