From: Frank Lahm Date: Wed, 14 Mar 2012 09:38:26 +0000 (+0100) Subject: Use reentrant strtok_r X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=e17be3b0c68a9ccbf88c1afbe57b98c026ba65f9 Use reentrant strtok_r --- diff --git a/etc/afpd/afp_config.c b/etc/afpd/afp_config.c index 0001eb13..02e56f73 100644 --- a/etc/afpd/afp_config.c +++ b/etc/afpd/afp_config.c @@ -76,7 +76,7 @@ int configinit(AFPObj *obj) { EC_INIT; DSI *dsi, **next = &obj->dsi; - char *p = NULL, *q = NULL; + char *p = NULL, *q = NULL, *savep; const char *r; auth_load(obj->options.uampath, obj->options.uamlist); @@ -92,7 +92,7 @@ int configinit(AFPObj *obj) if (obj->options.listen) { EC_NULL( q = p = strdup(obj->options.listen) ); - EC_NULL( p = strtok(p, ", ") ); + EC_NULL( p = strtok_r(p, ", ", &savep) ); } while (1) { @@ -109,7 +109,7 @@ int configinit(AFPObj *obj) if (p) /* p is NULL if ! obj->options.listen */ - p = strtok(NULL, ", "); + p = strtok_r(NULL, ", ", &savep); if (!p) break; }