diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:05 +0000 |
commit | 97e01009d69b8fbebfebf68f51e3d126d0ed43fc (patch) | |
tree | 02e8b836c3a9d89806f3e67d4a5fe9f52dbb0061 /libnetdata/config/appconfig.c | |
parent | Releasing debian version 1.36.1-1. (diff) | |
download | netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.tar.xz netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.zip |
Merging upstream version 1.37.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | libnetdata/config/appconfig.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libnetdata/config/appconfig.c b/libnetdata/config/appconfig.c index 1288366da..938c7dde2 100644 --- a/libnetdata/config/appconfig.c +++ b/libnetdata/config/appconfig.c @@ -32,8 +32,8 @@ _CONNECTOR_INSTANCE *add_connector_instance(struct section *connector, struct se local_ci = callocz(1, sizeof(struct _connector_instance)); local_ci->instance = instance; local_ci->connector = connector; - strncpy(local_ci->instance_name, instance->name, CONFIG_MAX_NAME); - strncpy(local_ci->connector_name, connector->name, CONFIG_MAX_NAME); + strncpyz(local_ci->instance_name, instance->name, CONFIG_MAX_NAME); + strncpyz(local_ci->connector_name, connector->name, CONFIG_MAX_NAME); local_ci->next = global_connector_instance; global_connector_instance = local_ci; @@ -473,7 +473,7 @@ NETDATA_DOUBLE appconfig_get_float(struct config *root, const char *section, con return str2ndd(s, NULL); } -static inline int appconfig_test_boolean_value(char *s) { +inline int appconfig_test_boolean_value(char *s) { if(!strcasecmp(s, "yes") || !strcasecmp(s, "true") || !strcasecmp(s, "on") || !strcasecmp(s, "auto") || !strcasecmp(s, "on demand")) return 1; @@ -686,14 +686,14 @@ int appconfig_load(struct config *root, char *filename, int overwrite_used, cons int rc; rc = is_valid_connector(s, 0); if (likely(rc)) { - strncpy(working_connector, s, CONFIG_MAX_NAME); + strncpyz(working_connector, s, CONFIG_MAX_NAME); s = s + rc + 1; if (unlikely(!(*s))) { _connectors++; sprintf(buffer, "instance_%d", _connectors); s = buffer; } - strncpy(working_instance, s, CONFIG_MAX_NAME); + strncpyz(working_instance, s, CONFIG_MAX_NAME); working_connector_section = NULL; if (unlikely(appconfig_section_find(root, working_instance))) { error("Instance (%s) already exists", working_instance); |