From f95e32a1284d9686593591ab80fa0fb7a0524d30 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 25 Jul 2008 16:17:18 +0200 Subject: [PATCH] examples/myplugin.c: Use sstrncpy instead of strcpy. Signed-off-by: Florian Forster --- contrib/examples/myplugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: "") */ -- 2.30.2