summaryrefslogtreecommitdiff
path: root/libc/string/strcspn.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-07 23:37:03 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-07 23:37:03 +0000
commitfbb4007ac88656122f9319dea4563a3a4fd40e82 (patch)
treeca4265ac43d139b3fd02ba32bfe6d5e12cadb65c /libc/string/strcspn.c
parentb8f03a94957c913fa0d8588c41b0332b49310ff0 (diff)
Update and simplification.
Diffstat (limited to 'libc/string/strcspn.c')
-rw-r--r--libc/string/strcspn.c19
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;
}