1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## myplugin_strcpy.dpatch by Sebastian Harl <sh@tokkee.org>
4
## DP: examples/myplugin.c: Use sstrncpy instead of strcpy.
8
diff a/contrib/examples/myplugin.c b/contrib/examples/myplugin.c
9
--- a/contrib/examples/myplugin.c
10
+++ b/contrib/examples/myplugin.c
11
@@ -98,8 +98,8 @@ static int my_read (void)
14
vl.time = time (NULL);
15
- strcpy (vl.host, hostname_g);
16
- strcpy (vl.plugin, "myplugin");
17
+ sstrncpy (vl.host, hostname_g, sizeof (vl.host));
18
+ sstrncpy (vl.plugin, "myplugin", sizeof (vl.plugin));
19
/* optionally set vl.plugin_instance and vl.type_instance to reasonable
20
* values (default: "") */