nginx plugin: Use `strtok_r' instead of `strtok'.
[collectd.git] / src / nginx.c
index a44e8a5..0e3b843 100644 (file)
@@ -171,6 +171,7 @@ static int nginx_read (void)
   char *ptr;
   char *lines[16];
   int   lines_num = 0;
+  char *saveptr;
 
   char *fields[16];
   int   fields_num;
@@ -188,7 +189,8 @@ static int nginx_read (void)
   }
 
   ptr = nginx_buffer;
-  while ((lines[lines_num] = strtok (ptr, "\n\r")) != NULL)
+  saveptr = NULL;
+  while ((lines[lines_num] = strtok_r (ptr, "\n\r", &saveptr)) != NULL)
   {
     ptr = NULL;
     lines_num++;