From 74e2e548960b6ca6dd3e599cd47727c7b7023ff0 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 8 Dec 2021 10:06:49 +0100 Subject: test-dhcp-option: rename variable to avoid global/local name conflict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeQL was complaining that the local variable obscurs the global one. It is indeed a bit confusing when reading this… Let's rename the variable to avoid confusing the reader. --- src/libsystemd-network/test-dhcp-option.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/libsystemd-network/test-dhcp-option.c') diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c index c4a0d4ccb2..2c82ac982d 100644 --- a/src/libsystemd-network/test-dhcp-option.c +++ b/src/libsystemd-network/test-dhcp-option.c @@ -278,7 +278,7 @@ static void test_option_removal(struct option_desc *desc) { assert_se(dhcp_option_parse(message, sizeof(DHCPMessage) + desc->len, NULL, NULL, NULL) < 0); } -static uint8_t options[64] = { +static uint8_t the_options[64] = { 'A', 'B', 'C', 'D', 160, 2, 0x11, 0x12, 0, @@ -316,16 +316,16 @@ static void test_option_set(void) { offset = pos = 4; len = 11; - while (pos < len && options[pos] != SD_DHCP_OPTION_END) { + while (pos < len && the_options[pos] != SD_DHCP_OPTION_END) { assert_se(dhcp_option_append(result, len, &offset, DHCP_OVERLOAD_SNAME, - options[pos], - options[pos + 1], - &options[pos + 2]) >= 0); + the_options[pos], + the_options[pos + 1], + &the_options[pos + 2]) >= 0); - if (options[pos] == SD_DHCP_OPTION_PAD) + if (the_options[pos] == SD_DHCP_OPTION_PAD) pos++; else - pos += 2 + options[pos + 1]; + pos += 2 + the_options[pos + 1]; if (pos < len) assert_se(offset == pos); @@ -334,8 +334,8 @@ static void test_option_set(void) { for (i = 0; i < 9; i++) { if (verbose) printf("%2u: 0x%02x(0x%02x) (options)\n", i, result->options[i], - options[i]); - assert_se(result->options[i] == options[i]); + the_options[i]); + assert_se(result->options[i] == the_options[i]); } if (verbose) @@ -353,8 +353,8 @@ static void test_option_set(void) { for (i = 0; i < pos - 8; i++) { if (verbose) printf("%2u: 0x%02x(0x%02x) (sname)\n", i, result->sname[i], - options[i + 9]); - assert_se(result->sname[i] == options[i + 9]); + the_options[i + 9]); + assert_se(result->sname[i] == the_options[i + 9]); } if (verbose) -- cgit v1.2.3