aboutsummaryrefslogtreecommitdiffstats
path: root/src/config
diff options
context:
space:
mode:
Diffstat (limited to 'src/config')
-rw-r--r--src/config/ConfigData.hxx2
-rw-r--r--src/config/ConfigGlobal.cxx1
-rw-r--r--src/config/ConfigParser.cxx4
-rw-r--r--src/config/ConfigTemplates.cxx4
4 files changed, 6 insertions, 5 deletions
diff --git a/src/config/ConfigData.hxx b/src/config/ConfigData.hxx
index e42d674ba..1a16fae7f 100644
--- a/src/config/ConfigData.hxx
+++ b/src/config/ConfigData.hxx
@@ -109,7 +109,7 @@ struct config_param {
const char *default_value=nullptr) const;
/**
- * Same as config_dup_path(), but looks up the setting in the
+ * Same as config_get_path(), but looks up the setting in the
* specified block.
*/
AllocatedPath GetBlockPath(const char *name, const char *default_value,
diff --git a/src/config/ConfigGlobal.cxx b/src/config/ConfigGlobal.cxx
index 9bc83398c..06b41de80 100644
--- a/src/config/ConfigGlobal.cxx
+++ b/src/config/ConfigGlobal.cxx
@@ -38,6 +38,7 @@ void config_global_finish(void)
{
for (auto i : config_data.params)
delete i;
+ config_data.params.fill(0);
}
void config_global_init(void)
diff --git a/src/config/ConfigParser.cxx b/src/config/ConfigParser.cxx
index 3535c9a13..da7d58e49 100644
--- a/src/config/ConfigParser.cxx
+++ b/src/config/ConfigParser.cxx
@@ -23,8 +23,8 @@
bool
get_bool(const char *value, bool *value_r)
{
- static const char *t[] = { "yes", "true", "1", nullptr };
- static const char *f[] = { "no", "false", "0", nullptr };
+ static const char *const t[] = { "yes", "true", "1", nullptr };
+ static const char *const f[] = { "no", "false", "0", nullptr };
if (string_array_contains(t, value)) {
*value_r = true;
diff --git a/src/config/ConfigTemplates.cxx b/src/config/ConfigTemplates.cxx
index 58ee56425..801ee8b20 100644
--- a/src/config/ConfigTemplates.cxx
+++ b/src/config/ConfigTemplates.cxx
@@ -19,6 +19,7 @@
#include "ConfigTemplates.hxx"
#include "ConfigOption.hxx"
+#include "util/Macros.hxx"
#include <string.h>
@@ -81,8 +82,7 @@ const ConfigTemplate config_templates[] = {
{ "neighbors", true, true },
};
-static constexpr unsigned n_config_templates =
- sizeof(config_templates) / sizeof(config_templates[0]);
+static constexpr unsigned n_config_templates = ARRAY_SIZE(config_templates);
static_assert(n_config_templates == unsigned(CONF_MAX),
"Wrong number of config_templates");