]> arthur.barton.de Git - netatalk.git/commitdiff
Use reentrant strtok_r
authorFrank Lahm <franklahm@googlemail.com>
Wed, 14 Mar 2012 09:38:26 +0000 (10:38 +0100)
committerFrank Lahm <franklahm@googlemail.com>
Wed, 14 Mar 2012 09:38:26 +0000 (10:38 +0100)
etc/afpd/afp_config.c

index 0001eb13a05a2d2c53580eb73a19787fb758e97d..02e56f733b0fcb3917d4d94d4b6f2228b725f624 100644 (file)
@@ -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;
     }