contrib/exec-nagios.px: Make it possible to run the same script multiple times.
[collectd.git] / src / load.c
index 15215d3..72c7756 100644 (file)
@@ -51,10 +51,11 @@ static void load_submit (gauge_t snum, gauge_t mnum, gauge_t lnum)
        vl.values = values;
        vl.values_len = STATIC_ARRAY_SIZE (values);
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "load");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "load", sizeof (vl.plugin));
+       sstrncpy (vl.type, "load", sizeof (vl.type));
 
-       plugin_dispatch_values ("load", &vl);
+       plugin_dispatch_values (&vl);
 }
 
 static int load_read (void)