processes plugin: Use STATIC_ARRAY_SIZE instead of numeric value.
[collectd.git] / src / interface.c
index 741ff76..ff4a0aa 100644 (file)
 #  include <ifaddrs.h>
 #endif
 
+#if HAVE_STATGRAB_H
+# include <statgrab.h>
+#endif
+
 /*
  * Various people have reported problems with `getifaddrs' and varying versions
  * of `glibc'. That's why it's disabled by default. Since more statistics are
@@ -195,9 +199,10 @@ static void if_submit (const char *dev, const char *type,
        vl.time = time (NULL);
        strcpy (vl.host, hostname_g);
        strcpy (vl.plugin, "interface");
-       strncpy (vl.type_instance, dev, sizeof (vl.type_instance));
+       sstrncpy (vl.type, type, sizeof (vl.type));
+       sstrncpy (vl.type_instance, dev, sizeof (vl.type_instance));
 
-       plugin_dispatch_values (type, &vl);
+       plugin_dispatch_values (&vl);
 } /* void if_submit */
 
 static int interface_read (void)