Merge branch 'collectd-4.4'
[collectd.git] / src / swap.c
index 4f0a0ba..f9debc1 100644 (file)
@@ -124,9 +124,9 @@ static void swap_submit (const char *type_instance, double value)
        vl.values = values;
        vl.values_len = 1;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "swap");
-       strcpy (vl.type, "swap");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
+       sstrncpy (vl.type, "swap", sizeof (vl.type));
        sstrncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
 
        plugin_dispatch_values (&vl);