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

« back to all changes in this revision

Viewing changes to src/nginx.c

  • 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:
177
177
  vl.values = values;
178
178
  vl.values_len = 1;
179
179
  vl.time = time (NULL);
180
 
  strcpy (vl.host, hostname_g);
181
 
  strcpy (vl.plugin, "nginx");
182
 
  strcpy (vl.plugin_instance, "");
 
180
  sstrncpy (vl.host, hostname_g, sizeof (vl.host));
 
181
  sstrncpy (vl.plugin, "nginx", sizeof (vl.plugin));
 
182
  sstrncpy (vl.plugin_instance, "", sizeof (vl.plugin_instance));
183
183
 
184
184
  if (inst != NULL)
185
185
  {
197
197
  char *ptr;
198
198
  char *lines[16];
199
199
  int   lines_num = 0;
 
200
  char *saveptr;
200
201
 
201
202
  char *fields[16];
202
203
  int   fields_num;
214
215
  }
215
216
 
216
217
  ptr = nginx_buffer;
217
 
  while ((lines[lines_num] = strtok (ptr, "\n\r")) != NULL)
 
218
  saveptr = NULL;
 
219
  while ((lines[lines_num] = strtok_r (ptr, "\n\r", &saveptr)) != NULL)
218
220
  {
219
221
    ptr = NULL;
220
222
    lines_num++;