}
static int parse_value (const data_set_t *ds, value_list_t *vl,
- const char *type,
FILE *fh, char *buffer)
{
char *dummy;
return (-1);
}
- plugin_dispatch_values (type, vl);
+ plugin_dispatch_values (vl);
return (0);
} /* int parse_value */
return (-1);
}
- strcpy (vl.host, hostname);
- strcpy (vl.plugin, plugin);
+ sstrncpy (vl.host, hostname, sizeof (vl.host));
+ sstrncpy (vl.plugin, plugin, sizeof (vl.plugin));
+ sstrncpy (vl.type, type, sizeof (vl.type));
if (plugin_instance != NULL)
- strcpy (vl.plugin_instance, plugin_instance);
+ sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance));
if (type_instance != NULL)
- strcpy (vl.type_instance, type_instance);
+ sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
ds = plugin_get_ds (type);
if (ds == NULL) {
/* It's parse_value's job to write an error to `fh'.
* This is not the case with `parse_option below.
* Neither will write an success message. */
- if (parse_value (ds, &vl, type, fh, fields[i]) != 0)
+ if (parse_value (ds, &vl, fh, fields[i]) != 0)
break;
}
else if (strchr (fields[i], '=') != NULL)