From c6bbc09d2791606d91b5e2434774a5fae921b1e2 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Wed, 11 Jun 2008 14:24:34 +0200 Subject: [PATCH] nginx plugin: Use `strtok_r' instead of `strtok'. --- src/nginx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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++; -- 2.30.2