X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;ds=sidebyside;f=contrib%2Fexamples%2Fmyplugin.c;h=f68cc1ac85c090792efa1bfe9433272327b378fa;hb=148e8732e45435a051df1c3673cad0d5dc77492f;hp=240c6c3a8932cd0f8c31e485edf202ca96e93d38;hpb=10075e6fe3c384b73c2dd398a1435f8d10e56654;p=collectd.git diff --git a/contrib/examples/myplugin.c b/contrib/examples/myplugin.c index 240c6c3a..f68cc1ac 100644 --- a/contrib/examples/myplugin.c +++ b/contrib/examples/myplugin.c @@ -98,8 +98,8 @@ static int my_read (void) vl.values = values; vl.values_len = 1; vl.time = time (NULL); - strcpy (vl.host, hostname_g); - strcpy (vl.plugin, "myplugin"); + sstrncpy (vl.host, hostname_g, sizeof (vl.host)); + sstrncpy (vl.plugin, "myplugin", sizeof (vl.plugin)); /* optionally set vl.plugin_instance and vl.type_instance to reasonable * values (default: "") */