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