lkml.org 
[lkml]   [2002]   [Feb]   [9]   [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 to use strsep for fs/fat/inode.c
Date
Hi,

This patch changes all 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/fat/inode.c linux/fs/fat/inode.c
--- linux-2.5.3-dj4/fs/fat/inode.c Sat Feb 9 21:57:39 2002
+++ linux/fs/fat/inode.c Sun Feb 10 03:47:48 2002
@@ -223,8 +223,9 @@
goto out;
save = 0;
savep = NULL;
- 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;

-
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.019 / U:3.160 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site