public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch][2.5.4-dj4] cleanup, use strsep in tridentfb.c
@ 2002-02-10 12:25 Alex Scheele
  0 siblings, 0 replies; only message in thread
From: Alex Scheele @ 2002-02-10 12:25 UTC (permalink / raw)
  To: jani; +Cc: Dave Jones, Lkml

Hi,

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


--
	Alex (alex@packetstorm.nu)


-------------------------- cut here -------------------------
diff -Nru linux-2.5.3-dj4/drivers/video/tridentfb.c linux/drivers/video/tridentfb.c
--- linux-2.5.3-dj4/drivers/video/tridentfb.c Sat Feb  9 21:03:01 2002
+++ linux/drivers/video/tridentfb.c Sat Feb  9 21:03:01 2002
@@ -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))



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-02-10 12:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-10 12:25 [patch][2.5.4-dj4] cleanup, use strsep in tridentfb.c Alex Scheele

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox