From 9c6827519c6fd93265c6b556ec847628c7e28634 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 19 Mar 2020 19:17:31 +0100 Subject: conservatively use strtok_r --- src/lib/sync_api_download.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib/sync_api_download.c') 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); -- cgit v1.2.3