public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alex Scheele" <alex@packetstorm.nu>
To: <jani@astechnix.ro>
Cc: "Dave Jones" <davej@suse.de>, "Lkml" <linux-kernel@vger.kernel.org>
Subject: [patch][2.5.4-dj4] cleanup, use strsep in tridentfb.c
Date: Sun, 10 Feb 2002 13:25:46 +0100	[thread overview]
Message-ID: <IOEMLDKDBECBHMIOCKODEEMOCJAA.alex@packetstorm.nu> (raw)

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))



                 reply	other threads:[~2002-02-10 12:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=IOEMLDKDBECBHMIOCKODEEMOCJAA.alex@packetstorm.nu \
    --to=alex@packetstorm.nu \
    --cc=davej@suse.de \
    --cc=jani@astechnix.ro \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox