Code

iptables plugin, utils_ignorelist: Fixed an off-by-one error each.
[collectd.git] / src / serial.c
index 1c5d5a5594389a140d3de387e5d4e83237f5b5d2..1c874e52177e919d59056126015da12edf760109 100644 (file)
@@ -41,9 +41,9 @@ static void serial_submit (const char *type_instance,
        vl.values = values;
        vl.values_len = 2;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "serial");
-       strcpy (vl.type, "serial_octets");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "serial", sizeof (vl.plugin));
+       sstrncpy (vl.type, "serial_octets", sizeof (vl.type));
        sstrncpy (vl.type_instance, type_instance,
                        sizeof (vl.type_instance));