Replace all occurrences of `strcpy' with `sstrncpy'.
[collectd.git] / src / cpufreq.c
index 42248a9..74e542b 100644 (file)
@@ -68,8 +68,8 @@ static void cpufreq_submit (int cpu_num, double value)
        vl.values = values;
        vl.values_len = 1;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "cpufreq");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
        snprintf (vl.type_instance, sizeof (vl.type_instance),
                        "%i", cpu_num);