summaryrefslogtreecommitdiffstats
path: root/libnetdata/config/appconfig.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnetdata/config/appconfig.c')
-rw-r--r--libnetdata/config/appconfig.c10
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);