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/strcspn.c | |
parent | b8f03a94957c913fa0d8588c41b0332b49310ff0 (diff) |
Update and simplification.
Diffstat (limited to 'libc/string/strcspn.c')
-rw-r--r-- | libc/string/strcspn.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/libc/string/strcspn.c b/libc/string/strcspn.c index 3630a1333..d30195db1 100644 --- a/libc/string/strcspn.c +++ b/libc/string/strcspn.c @@ -33,18 +33,15 @@ /* Return the length of the maximum initial segment of S which contains no characters from REJECT. */ -size_t -strcspn (s, reject) - const char *s; - const char *reject; +size_t strcspn( const char *s, const char *reject) { - size_t count = 0; + size_t count = 0; - while (*s != '\0') - if (strchr (reject, *s++) == NULL) - ++count; - else - return count; + while (*s != '\0') + if (strchr(reject, *s++) == NULL) + ++count; + else + return count; - return count; + return count; } |