Replace all occurrences of `strcpy' with `sstrncpy'.
[collectd.git] / src / hddtemp.c
index 36ada53..cb49577 100644 (file)
@@ -449,8 +449,8 @@ static void hddtemp_submit (char *type_instance, double value)
        vl.values = values;
        vl.values_len = 1;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "hddtemp");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "hddtemp", sizeof (vl.plugin));
        strncpy (vl.type_instance, type_instance, sizeof (vl.type_instance));
 
        plugin_dispatch_values ("temperature", &vl);