lkml.org 
[lkml]   [2002]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[patch][2.5.4-dj4] cleanup, use strsep in tridentfb.c
Date
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))

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.074 / U:2.960 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site