From 82f9d834ad772b2f16b6524f679d14d8a7afe881 Mon Sep 17 00:00:00 2001 From: Gabriele Contini <gcontini@users.noreply.github.com> Date: 周二, 10 9月 2019 23:29:10 +0800 Subject: [PATCH] fix issue #37 tests in windows --- src/library/pc-identifiers.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/library/pc-identifiers.c b/src/library/pc-identifiers.c index 68cc71d..59f3dd1 100644 --- a/src/library/pc-identifiers.c +++ b/src/library/pc-identifiers.c @@ -39,11 +39,11 @@ if (identifiers == NULL || *num_identifiers == 0) { result_adapterInfos = getAdapterInfos(NULL, &adapter_num); - if (result_adapterInfos != FUNC_RET_OK) { + if ((result_adapterInfos != FUNC_RET_OK) || (adapter_num == 0)) { return generate_disk_pc_id(identifiers, num_identifiers, false); } result_diskinfos = getDiskInfos(NULL, &disk_num); - if (result_diskinfos != FUNC_RET_OK) { + if ((result_diskinfos != FUNC_RET_OK) || (disk_num == 0)) { return generate_ethernet_pc_id(identifiers, num_identifiers, true); } *num_identifiers = disk_num * adapter_num; @@ -283,7 +283,7 @@ PcIdentifier concat_identifiers[2]; char* b64_data = NULL; int b64_size = 0; - size_t concatIdentifiersSize = sizeof(PcIdentifier) * 2; + const size_t concatIdentifiersSize = sizeof(PcIdentifier) * 2; //concat_identifiers = (PcIdentifier *) malloc(concatIdentifiersSize); memcpy(&concat_identifiers[0], identifier1, sizeof(PcIdentifier)); memcpy(&concat_identifiers[1], identifier2, sizeof(PcIdentifier)); -- Gitblit v1.9.1