From efa84b551b102245efb67dd44a944d983ffb0411 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 19 Mar 2020 19:40:34 +0100 Subject: [PATCH] use strtok_r in code that could plausibly be used from multi-threaded applications --- src/util/strings.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/strings.c b/src/util/strings.c index 981718e4c..ac9805cdd 100644 --- a/src/util/strings.c +++ b/src/util/strings.c @@ -266,11 +266,14 @@ convert_with_table (const char *input, const char *tok; unsigned long long last; unsigned int i; + char *sptr; ret = 0; last = 0; in = GNUNET_strdup (input); - for (tok = strtok (in, " "); tok != NULL; tok = strtok (NULL, " ")) + for (tok = strtok_r (in, " ", &sptr); + tok != NULL; + tok = strtok_r (NULL, " ", &sptr)) { do { -- 2.25.1