summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-19 19:40:34 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-19 19:40:34 +0100
commitefa84b551b102245efb67dd44a944d983ffb0411 (patch)
treec7c93024bddf7810608146f4e96eed9c680309a9 /src/util
parentd12534331d2b77b3f3fec3ce735ccdf3daffbabe (diff)
use strtok_r in code that could plausibly be used from multi-threaded applications
Diffstat (limited to 'src/util')
-rw-r--r--src/util/strings.c5
1 files changed, 4 insertions, 1 deletions
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
{