From: Karol Lewandowski Date: Thu, 21 Nov 2024 23:14:11 +0000 (+0100) Subject: Fix issues reported by SVACE X-Git-Tag: accepted/tizen/unified/20241122.171551^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9d2e3669efb8210f301b44327c75249a0662488;p=platform%2Fcore%2Fapi%2Fperipheral-io.git Fix issues reported by SVACE Change-Id: I5ad76a3fd65a16c111539306bf662bf7b6528789 --- diff --git a/packaging/capi-system-peripheral-io.spec b/packaging/capi-system-peripheral-io.spec index b0c4eb3..33761ac 100644 --- a/packaging/capi-system-peripheral-io.spec +++ b/packaging/capi-system-peripheral-io.spec @@ -1,6 +1,6 @@ Name: capi-system-peripheral-io Summary: Tizen Peripheral Input & Output library -Version: 0.4.1 +Version: 0.4.2 Release: 0 Group: System & System Tools License: Apache-2.0 diff --git a/test/peripheral-io-test.c b/test/peripheral-io-test.c index 364858e..f702930 100644 --- a/test/peripheral-io-test.c +++ b/test/peripheral-io-test.c @@ -102,14 +102,14 @@ static int __get_feature(const char *key, bool *feature) static bool __skip_check(char *name) { size_t n = sizeof(skip_test_list) / sizeof(skip_test_list[0]); - for (int i = 0; i < n; ++i) - if (!strcmp(skip_test_list[i].model_name, model_name) && !strcmp(skip_test_list[i].test_name, name)) + for (unsigned int u = 0; u < n; ++u) + if (!strcmp(skip_test_list[u].model_name, model_name) && !strcmp(skip_test_list[u].test_name, name)) return true; if (i2c_no_stub_driver) { n = sizeof(skip_test_list_i2c_no_stub_driver) / sizeof(skip_test_list_i2c_no_stub_driver[0]); - for (int i = 0; i < n; i++) - if (!strcmp(skip_test_list_i2c_no_stub_driver[i], name)) + for (unsigned int u = 0; u < n; u++) + if (!strcmp(skip_test_list_i2c_no_stub_driver[u], name)) return true; } return false; diff --git a/test/src/test_peripheral_i2c.c b/test/src/test_peripheral_i2c.c index d973fa1..00a0fef 100644 --- a/test/src/test_peripheral_i2c.c +++ b/test/src/test_peripheral_i2c.c @@ -61,7 +61,7 @@ static int __find_stub_driver(void) n = fread(name, sizeof(char), sizeof(name), fp); fclose(fp); - if (strncmp(name, "SMBus stub driver", n) == 0) { + if (n > 0 && strncmp(name, "SMBus stub driver", n) == 0) { ret = bus; goto cleanup; }