summaryrefslogtreecommitdiff
path: root/libc/string/strcspn.c
diff options
context:
space:
mode:
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;
}