* [patch][2.5.4-dj4] cleanup to use strsep in
@ 2002-02-10 1:40 Alex Scheele
0 siblings, 0 replies; only message in thread
From: Alex Scheele @ 2002-02-10 1:40 UTC (permalink / raw)
To: chaffee; +Cc: Dave Jones, Lkml
Hi,
This patch changes the use of strtok() to strsep().
Strtok() isn't SMP/thread safe. strsep is considered safer.
--
Alex (alex@packetstorm.nu)
-------------------------- cut here -------------------------
diff -uN linux-2.5.3-dj4/fs/vfat/namei.c linux/fs/vfat/namei.c
--- linux-2.5.3-dj4/fs/vfat/namei.c Mon Jan 28 22:20:44 2002
+++ linux/fs/vfat/namei.c Sun Feb 10 03:41:26 2002
@@ -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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-02-10 1:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-10 1:40 [patch][2.5.4-dj4] cleanup to use strsep in Alex Scheele
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox