gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-anastasis] 02/02: conservatively use strtok_r


From: gnunet
Subject: [taler-anastasis] 02/02: conservatively use strtok_r
Date: Sat, 04 Apr 2020 11:41:12 +0200

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

commit 711c248f4dfd0b93fa9913c8db6e017fd67c13ee
Author: Dennis Neufeld <address@hidden>
AuthorDate: Sat Apr 4 09:41:04 2020 +0000

    conservatively use strtok_r
---
 src/lib/anastasis_api_policy_lookup.c | 11 +++++++----
 src/lib/anastasis_api_policy_store.c  | 11 +++++++----
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/src/lib/anastasis_api_policy_lookup.c 
b/src/lib/anastasis_api_policy_lookup.c
index a216c2d..9d2abed 100644
--- a/src/lib/anastasis_api_policy_lookup.c
+++ b/src/lib/anastasis_api_policy_lookup.c
@@ -214,18 +214,21 @@ handle_header (char *buffer,
   char *ndup;
   const char *hdr_type;
   char *hdr_val;
+  char *sp;
 
   ndup = GNUNET_strndup (buffer,
                          total);
-  hdr_type = strtok (ndup,
-                     ":");
+  hdr_type = strtok_r (ndup,
+                       ":",
+                       &sp);
   if (NULL == hdr_type)
   {
     GNUNET_free (ndup);
     return total;
   }
-  hdr_val = strtok (NULL,
-                    "\n\r");
+  hdr_val = strtok_r (NULL,
+                      "\n\r",
+                      &sp);
   if (NULL == hdr_val)
   {
     GNUNET_free (ndup);
diff --git a/src/lib/anastasis_api_policy_store.c 
b/src/lib/anastasis_api_policy_store.c
index 413de05..36834bd 100644
--- a/src/lib/anastasis_api_policy_store.c
+++ b/src/lib/anastasis_api_policy_store.c
@@ -210,18 +210,21 @@ handle_header (char *buffer,
   char *ndup;
   const char *hdr_type;
   char *hdr_val;
+  char *sp;
 
   ndup = GNUNET_strndup (buffer,
                          total);
-  hdr_type = strtok (ndup,
-                     ":");
+  hdr_type = strtok_r (ndup,
+                       ":",
+                       &sp);
   if (NULL == hdr_type)
   {
     GNUNET_free (ndup);
     return total;
   }
-  hdr_val = strtok (NULL,
-                    "");
+  hdr_val = strtok_r (NULL,
+                      "",
+                      &sp);
   if (NULL == hdr_val)
   {
     GNUNET_free (ndup);

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]