Skip to contentSkip to conversation

cleanup to use strsep in

PATCH New Alex Scheele 1 participant 1 message Feb 10, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cleanup to use strsep in

Hi,

This patch changes the use of strtok() to strsep(). Strtok() isn't SMP/thread safe. strsep is considered safer.

--
Alex ([email protected])

-------------------------- cut here -------------------------

fs/vfat/namei.c Sun Feb 10 03:41:26 2002 renamed from fs/vfat/namei.c Mon Jan 28 22:20:44 2002 +3 -1
diff -uN linux-2.5.3-dj4/fs/vfat/namei.c linux/fs/vfat/namei.c
@@ -114,7 +114,9 @@
        save = 0;
        savep = NULL;
        ret = 1;
-       for (this_char = strtok(options,","); this_char; this_char = strtok(NULL,",")) {
+       while ((this_char = strsep(&options,",")) != NULL) {
+               if (!*this_char)
+                       continue;
                if ((value = strchr(this_char,'=')) != NULL) {
                        save = *value;
                        savep = value;