Merge branch 'collectd-5.5' into collectd-5.6
[collectd.git] / contrib / examples / myplugin.c
index 9539062..ab3ec2f 100644 (file)
@@ -39,6 +39,7 @@
 #endif /* ! HAVE_CONFIG */
 
 #include <collectd/collectd.h>
+
 #include <collectd/common.h>
 #include <collectd/plugin.h>
 
@@ -103,7 +104,7 @@ static int my_read (void)
 
        /* it is strongly recommended to use a type defined in the types.db file
         * instead of a custom type */
-       sstrncpy (vl.type, "myplugin", sizeof (vl.plugin));
+       sstrncpy (vl.type, "myplugin", sizeof (vl.type));
        /* optionally set vl.plugin_instance and vl.type_instance to reasonable
         * values (default: "") */
 
@@ -113,7 +114,7 @@ static int my_read (void)
 
        /* A return value != 0 indicates an error and the plugin will be skipped
         * for an increasing amount of time. */
-    return 0;
+       return 0;
 } /* static int my_read (void) */
 
 /*