X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrtok.c;h=70d2cd702fe196b7bf8d2a68a078312bdadc3681;hb=c8f799d852e3698468a78954d82588e841cc0b70;hp=69b45a73cb8aeb0753395907425beed9643ce13f;hpb=5e125f38b2aba7d706a9143727e2ef72d58391dc;p=pdclib.old diff --git a/functions/string/strtok.c b/functions/string/strtok.c index 69b45a7..70d2cd7 100644 --- a/functions/string/strtok.c +++ b/functions/string/strtok.c @@ -1,9 +1,9 @@ -// ---------------------------------------------------------------------------- -// $Id$ -// ---------------------------------------------------------------------------- -// Public Domain C Library - http://pdclib.sourceforge.net -// This code is Public Domain. Use, modify, and redistribute at will. -// ---------------------------------------------------------------------------- +/* ---------------------------------------------------------------------------- + * $Id$ + * ---------------------------------------------------------------------------- + * Public Domain C Library - http://pdclib.sourceforge.net + * This code is Public Domain. Use, modify, and redistribute at will. + * --------------------------------------------------------------------------*/ char * strtok( char * restrict src, const char * restrict seperators ) { @@ -12,24 +12,24 @@ char * strtok( char * restrict src, const char * restrict seperators ) if ( src != NULL ) { - // new string + /* new string */ store = src; } if ( store == NULL ) { - // no old string, no new string, nothing to do + /* no old string, no new string, nothing to do */ return NULL; } - src += strspn( src, seperators ); // skipping leading seperators + src += strspn( src, seperators ); /* skipping leading seperators */ if ( strlen( src ) == 0 ) { - // no more to parse + /* no more to parse */ return ( store = NULL ); } token_length = strcspn( src, seperators ); if ( src[ token_length ] == '\0' ) { - // parsed to end of string + /* parsed to end of string */ store = NULL; return src; }