~ubuntu-branches/ubuntu/oneiric/collectd/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/myplugin_strcpy.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Morten Kjeldgaard
  • Date: 2008-11-18 15:54:20 UTC
  • mfrom: (1.1.5 upstream) (3.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20081118155420-sc2mxv2pebafkmon
Tags: 4.4.2-2ubuntu1
* Merge from Debian unstable (LP: #298828). Remaining Ubuntu changes:
* Add ubuntu_in6-glibc28.dpatch patch, fix FTBFS.
* Add ubuntu_hardening.dpatch patch, fix FTBFS.
* Add ubuntu_perl.c.dpatch, fix FTBFS.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## myplugin_strcpy.dpatch by Sebastian Harl <sh@tokkee.org>
 
3
##
 
4
## DP: examples/myplugin.c: Use sstrncpy instead of strcpy.
 
5
 
 
6
@DPATCH@
 
7
 
 
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)
 
12
        vl.values     = values;
 
13
        vl.values_len = 1;
 
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: "") */
 
21