Replace all occurrences of `strcpy' with `sstrncpy'.
[collectd.git] / src / swap.c
index e91ebef..4d1f24d 100644 (file)
@@ -124,8 +124,8 @@ 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");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "swap", sizeof (vl.plugin));
        strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
 
        plugin_dispatch_values ("swap", &vl);