summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-19 19:17:56 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-19 19:17:56 +0100
commit749d9615d12127a33445ceae21a8fa388d2f64a1 (patch)
treeed93cfb3457ddde0b9ff6c527495bb5ad59f4dba /src/exchange
parent15489275ba72905a6f0d84238480569390475c00 (diff)
downloadexchange-749d9615d12127a33445ceae21a8fa388d2f64a1.tar.gz
exchange-749d9615d12127a33445ceae21a8fa388d2f64a1.tar.bz2
exchange-749d9615d12127a33445ceae21a8fa388d2f64a1.zip
concurrency requires strtok_r
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd.c b/src/exchange/taler-exchange-httpd.c
index 0754163bf..feb599bd0 100644
--- a/src/exchange/taler-exchange-httpd.c
+++ b/src/exchange/taler-exchange-httpd.c
@@ -352,21 +352,22 @@ proceed_with_handler (const struct TEH_RequestHandler *rh,
{
unsigned int i;
const char *fin;
+ char *sp;
- /* make a copy of 'url' because 'strtok()' will modify */
+ /* make a copy of 'url' because 'strtok_r()' will modify */
memcpy (d,
url,
ulen);
i = 0;
- args[i++] = strtok (d, "/");
+ args[i++] = strtok_r (d, "/", &sp);
while ( (NULL != args[i - 1]) &&
(i < rh->nargs) )
- args[i++] = strtok (NULL, "/");
+ args[i++] = strtok_r (NULL, "/", &sp);
/* make sure above loop ran nicely until completion, and also
that there is no excess data in 'd' afterwards */
if ( (i != rh->nargs) ||
(NULL == args[i - 1]) ||
- (NULL != (fin = strtok (NULL, "/"))) )
+ (NULL != (fin = strtok_r (NULL, "/", &sp))) )
{
char emsg[128 + 512];