diff options
Diffstat (limited to 'libc/string/strspn.c')
-rw-r--r-- | libc/string/strspn.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/libc/string/strspn.c b/libc/string/strspn.c index 5f64a6f75..70b510a7f 100644 --- a/libc/string/strspn.c +++ b/libc/string/strspn.c @@ -22,25 +22,21 @@ /* Return the length of the maximum initial segment of S which contains only characters in ACCEPT. */ -size_t -strspn (s, accept) - const char *s; - const char *accept; +size_t strspn( const char *s, const char *accept) { - const char *p; - const char *a; - size_t count = 0; - - for (p = s; *p != '\0'; ++p) - { - for (a = accept; *a != '\0'; ++a) - if (*p == *a) - break; - if (*a == '\0') - return count; - else - ++count; - } + const char *p; + const char *a; + size_t count = 0; + + for (p = s; *p != '\0'; ++p) { + for (a = accept; *a != '\0'; ++a) + if (*p == *a) + break; + if (*a == '\0') + return count; + else + ++count; + } - return count; + return count; } |