Skip to contentSkip to conversation

cleanup, use strsep in tridentfb.c

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cleanup, use strsep in tridentfb.c

Hi,

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

--
Alex ([email protected])

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

drivers/video/tridentfb.c Sat Feb 9 21:03:01 2002 +2 -2
diff -Nru linux-2.5.3-dj4/drivers/video/tridentfb.c linux/drivers/video/tridentfb.c
@@ -1259,8 +1259,8 @@
        char * opt;
        if (!options || !*options)
                return 0;
-       for(opt = strtok(options,",");opt;opt = strtok(NULL,",")){
-               if (!opt) continue;
+       while((opt=strsep(&options,",")) != NULL) {
+               if (!*opt) continue;
                if (!strncmp(opt,"noaccel",7))
                        noaccel = 1;
                else if (!strncmp(opt,"accel",5))