From: Otto Moerbeek Date: Fri, 13 Oct 2023 09:55:33 +0000 (+0200) Subject: Tidy X-Git-Tag: rec-5.0.0-alpha2~1^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07bee03a69e58c27ef70c7c30cf28dc484b62499;p=thirdparty%2Fpdns.git Tidy --- diff --git a/pdns/recursordist/settings/cxxsupport.cc b/pdns/recursordist/settings/cxxsupport.cc index 0251fbae7b..3be355ba1a 100644 --- a/pdns/recursordist/settings/cxxsupport.cc +++ b/pdns/recursordist/settings/cxxsupport.cc @@ -161,13 +161,15 @@ static void possiblyConvertACLFile(const string& includeDir, const string& apiDi result.emplace_back(val); } } - rust::string yaml; + + rust::string key = "allow_from"; + rust::string filekey = "allow_from_file"; if (filename == "allow-from") { - yaml = pdns::rust::settings::rec::allow_from_to_yaml_string_incoming("allow_from", "allow_from_file", result); - } - else { - yaml = pdns::rust::settings::rec::allow_from_to_yaml_string_incoming("allow_notify_from", "allow_notify_from_file", result); + key = "allow_notify_from"; + filekey = "allow_notify_from_file"; } + const auto yaml = pdns::rust::settings::rec::allow_from_to_yaml_string_incoming(key, filekey, result); + string yamlfilename = apiDir; yamlfilename.append("/").append(filename).append(".yml"); string tmpfilename = yamlfilename + ".tmp"; @@ -218,7 +220,7 @@ static void fileCopy(const string& src, const string& dst, Logr::log_t log) log->error(Logr::Error, err, "Error reading", "to", Logging::Loggable(src)); throw runtime_error("YAML Conversion"); } - ofconf.put(character); + ofconf.put(static_cast(character)); if (ofconf.bad()) { int err = errno; log->error(Logr::Error, err, "Error writing YAML", "to", Logging::Loggable(dst)); @@ -230,9 +232,9 @@ static void fileCopy(const string& src, const string& dst, Logr::log_t log) } static void possiblyConvertForwardsandAuths(const std::string& includeDir, const std::string& apiDir, Logr::log_t log) { - std::vector forwAndAuthFiles; + std::vector forwAndAuthFiles{}; ::arg().gatherIncludes(includeDir, "..conf", forwAndAuthFiles); - pdns::rust::settings::rec::Recursorsettings settings; + pdns::rust::settings::rec::Recursorsettings settings{}; for (const auto& file : forwAndAuthFiles) { auto yaml = pdns::settings::rec::oldStyleSettingsFileToYaml(file, false); pdns::rust::settings::rec::merge(settings, yaml);