]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#3451] Address Wshadow warnings
authorAndrei Pavel <andrei@isc.org>
Thu, 16 Oct 2025 10:34:30 +0000 (13:34 +0300)
committerAndrei Pavel <andrei@isc.org>
Sun, 26 Oct 2025 16:58:23 +0000 (18:58 +0200)
src/lib/dhcpsrv/tests/cfg_option_unittest.cc
src/lib/util/filesystem.cc

index dbcd5325ed8839a3d70e9f3335a5ce335b8af8e3..2e6797d23034c60307dc69e2cbe848f43fff959a 100644 (file)
@@ -1519,11 +1519,10 @@ TEST_F(CfgOptionTest, optionsWithClientClasses) {
 
     // Verify that CfgOption::get() with client classes returns
     // each one correctly.
-    for (auto &reference_desc : reference_options) {
-        OptionDescriptor found_desc = cfg.get(DHCP6_OPTION_SPACE, 777,
-                                              reference_desc.client_classes_);
+    for (OptionDescriptor const& rd : reference_options) {
+        found_desc = cfg.get(DHCP6_OPTION_SPACE, 777, rd.client_classes_);
         ASSERT_TRUE(found_desc.option_);
-        ASSERT_EQ(found_desc, reference_desc);
+        ASSERT_EQ(found_desc, rd);
     }
 }
 
index d250b75b7b5334dfc76a6097968e3b1f6958a977..fb0a0161ac312525759a82aa9cfc407d3282cfe5 100644 (file)
@@ -312,7 +312,6 @@ PathChecker::validatePath(const std::string input_path_str,
 std::string
 PathChecker::validateDirectory(const std::string input_path_str,
                                bool enforce_path /* = PathChecker::shouldEnforceSecurity() */) const {
-    std::string input_copy = trim(input_path_str);
     // We only allow absolute path equal to default. Catch an invalid path.
     if (!input_path_str.empty()) {
         std::string input_copy = input_path_str;