diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-07 23:37:03 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-07 23:37:03 +0000 |
commit | fbb4007ac88656122f9319dea4563a3a4fd40e82 (patch) | |
tree | ca4265ac43d139b3fd02ba32bfe6d5e12cadb65c /libc/string/strsep.c | |
parent | b8f03a94957c913fa0d8588c41b0332b49310ff0 (diff) |
Update and simplification.
Diffstat (limited to 'libc/string/strsep.c')
-rw-r--r-- | libc/string/strsep.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/libc/string/strsep.c b/libc/string/strsep.c index f4fdf503e..797807a91 100644 --- a/libc/string/strsep.c +++ b/libc/string/strsep.c @@ -19,21 +19,16 @@ Cambridge, MA 02139, USA. */ #include <string.h> -char * -strsep(pp, delim) -char **pp; -const char *delim; +char *strsep( char **pp, const char *delim) { - char *p, *q; + char *p, *q; - if (!(p = *pp)) - return 0; - if ((q = strpbrk (p, delim))) - { - *pp = q + 1; - *q = '\0'; - } - else - *pp = 0; - return p; + if (!(p = *pp)) + return 0; + if ((q = strpbrk(p, delim))) { + *pp = q + 1; + *q = '\0'; + } else + *pp = 0; + return p; } |