X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvmem.c;h=d32f1db8cf42e9b2e155db93f0bf32df89f51e39;hb=0d5c879672770e3b8a740727fb223a6febdeaa27;hp=1e826a16b8a701bd5367dd3f1fc5e7a9de76bdc8;hpb=4e6812d3e5073e5b4bd7eaef9f2539c8c9dd28a4;p=collectd.git diff --git a/src/vmem.c b/src/vmem.c index 1e826a16..d32f1db8 100644 --- a/src/vmem.c +++ b/src/vmem.c @@ -45,9 +45,8 @@ static void submit (const char *plugin_instance, const char *type, vl.values = values; vl.values_len = values_len; - vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "vmem"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "vmem", sizeof (vl.plugin)); if (plugin_instance != NULL) sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); sstrncpy (vl.type, type, sizeof (vl.type)); @@ -78,9 +77,7 @@ static int vmem_config (const char *key, const char *value) { if (strcasecmp ("Verbose", key) == 0) { - if ((strcasecmp ("true", value) == 0) - || (strcasecmp ("yes", value) == 0) - || (strcasecmp ("on", value) == 0)) + if (IS_TRUE (value)) verbose_output = 1; else verbose_output = 0;