gnunet-svn
[Top][All Lists]
Advanced

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

[taler-sync] branch master updated: conservatively use strtok_r


From: gnunet
Subject: [taler-sync] branch master updated: conservatively use strtok_r
Date: Thu, 19 Mar 2020 19:17:34 +0100

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

grothoff pushed a commit to branch master
in repository sync.

The following commit(s) were added to refs/heads/master by this push:
     new 9c68275  conservatively use strtok_r
9c68275 is described below

commit 9c6827519c6fd93265c6b556ec847628c7e28634
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Mar 19 19:17:31 2020 +0100

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

diff --git a/src/lib/sync_api_download.c b/src/lib/sync_api_download.c
index 719c1dc..f381075 100644
--- a/src/lib/sync_api_download.c
+++ b/src/lib/sync_api_download.c
@@ -192,18 +192,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/sync_api_upload.c b/src/lib/sync_api_upload.c
index 97811e8..67a9477 100644
--- a/src/lib/sync_api_upload.c
+++ b/src/lib/sync_api_upload.c
@@ -197,18 +197,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]