From 52354daa1e98a0bd2920ccd4f36c7b755e08289c Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Tue, 21 Sep 2010 16:05:24 +0000 Subject: [PATCH] Stop target listing when the maximal wanted target count is reached. --- libnfc/nfc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libnfc/nfc.c b/libnfc/nfc.c index 891df85..a0befda 100644 --- a/libnfc/nfc.c +++ b/libnfc/nfc.c @@ -405,6 +405,8 @@ nfc_initiator_list_passive_targets (nfc_device_t * pnd, const nfc_modulation_t n if (szTargets > szTargetFound) { memcpy (&(anti[szTargetFound]), &nti, sizeof (nfc_target_info_t)); + } else { + break; } szTargetFound++; }