]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] strtok->strsep in atari config
authorDave Jones <davej@suse.de>
Wed, 3 Apr 2002 03:58:30 +0000 (19:58 -0800)
committerDave Jones <davej@suse.de>
Wed, 3 Apr 2002 03:58:30 +0000 (19:58 -0800)
arch/m68k/atari/config.c

index b96532afc891f7289ef0b35486d72d3e465f03eb..54c73f182070cee903667106ae63aa7708d21f87 100644 (file)
@@ -205,14 +205,16 @@ void __init atari_switches_setup( const char *str, unsigned len )
     char switches[len+1];
     char *p;
     int ovsc_shift;
+    char *args = switches;
 
-    /* copy string to local array, strtok works destructively... */
+    /* copy string to local array, strsep works destructively... */
     strncpy( switches, str, len );
     switches[len] = 0;
     atari_switches = 0;
 
     /* parse the options */
-    for( p = strtok( switches, "," ); p; p = strtok( NULL, "," ) ) {
+    while ((p = strsep(&args, ",")) != NULL) {
+       if (!*p) continue;
        ovsc_shift = 0;
        if (strncmp( p, "ov_", 3 ) == 0) {
            p += 3;