From: Florian Forster Date: Wed, 11 Jun 2008 12:24:34 +0000 (+0200) Subject: nginx plugin: Use `strtok_r' instead of `strtok'. X-Git-Tag: collectd-4.4.2~10^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c6bbc09d2791606d91b5e2434774a5fae921b1e2;p=collectd.git nginx plugin: Use `strtok_r' instead of `strtok'. --- diff --git a/src/nginx.c b/src/nginx.c index a44e8a57..0e3b843d 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -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++;