X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ffilecount.c;h=55b3655ebaccd877b1a3c844839d1fbcd4e60e79;hb=8a277e54b4ed7bccb4b3a2e7668792cd5303d3ac;hp=d15af757cbd9116e15083d821de3ded7cf746b35;hpb=44418e0346a3266d93f07349855766f1c1d30dbc;p=collectd.git diff --git a/src/filecount.c b/src/filecount.c index d15af757..55b3655e 100644 --- a/src/filecount.c +++ b/src/filecount.c @@ -74,7 +74,7 @@ static void fc_submit_dir (const fc_directory_conf_t *dir) sstrncpy (vl.type, "bytes", sizeof (vl.type)); plugin_dispatch_values (&vl); -} /* void qmail_submit */ +} /* void fc_submit_dir */ /* * Config: @@ -98,12 +98,12 @@ static int fc_config_set_instance (fc_directory_conf_t *dir, const char *str) char *ptr; char *copy; - strncpy (buffer, str, sizeof (buffer)); + sstrncpy (buffer, str, sizeof (buffer)); for (ptr = buffer; *ptr != 0; ptr++) if (*ptr == '/') - *ptr = '-'; + *ptr = '_'; - for (ptr = buffer; *ptr == '-'; ptr++) + for (ptr = buffer; *ptr == '_'; ptr++) /* do nothing */; if (*ptr == 0) @@ -342,10 +342,10 @@ static int fc_config_add_dir (oconfig_item_t *ci) dir->mtime = 0; dir->size = 0; + status = 0; for (i = 0; i < ci->children_num; i++) { oconfig_item_t *option = ci->children + i; - status = 0; if (strcasecmp ("Instance", option->key) == 0) status = fc_config_add_dir_instance (dir, option); @@ -414,7 +414,7 @@ static int fc_config (oconfig_item_t *ci) } /* for (ci->children) */ return (0); -} /* int qmail_config */ +} /* int fc_config */ static int fc_init (void) {