Replace all occurrences of `strcpy' with `sstrncpy'.
[collectd.git] / src / interface.c
index 33736b6..2add89d 100644 (file)
@@ -197,8 +197,8 @@ static void if_submit (const char *dev, const char *type,
        vl.values = values;
        vl.values_len = 2;
        vl.time = time (NULL);
-       strcpy (vl.host, hostname_g);
-       strcpy (vl.plugin, "interface");
+       sstrncpy (vl.host, hostname_g, sizeof (vl.host));
+       sstrncpy (vl.plugin, "interface", sizeof (vl.plugin));
        strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
 
        plugin_dispatch_values (type, &vl);