summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/phHal4Nfc_ADD.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/phHal4Nfc_ADD.c b/src/phHal4Nfc_ADD.c
index 0a3303c..727b7c4 100644
--- a/src/phHal4Nfc_ADD.c
+++ b/src/phHal4Nfc_ADD.c
@@ -671,11 +671,14 @@ void phHal4Nfc_TargetDiscoveryComplete(
if(phHal_eNfcIP1_Target ==
Hal4Ctxt->rem_dev_list[Count-1]->RemDevType)
{
- (void)memcpy(
- (void *)Hal4Ctxt->rem_dev_list[0],
- (void *)Hal4Ctxt->rem_dev_list[Count-1],
- sizeof(phHal_sRemoteDevInformation_t)
- );
+ if (Count != 1)
+ {
+ (void)memcpy(
+ (void *)Hal4Ctxt->rem_dev_list[0],
+ (void *)Hal4Ctxt->rem_dev_list[Count-1],
+ sizeof(phHal_sRemoteDevInformation_t)
+ );
+ }
NfcIpDeviceCount = 1;
break;
}