From fbb4007ac88656122f9319dea4563a3a4fd40e82 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Sat, 7 Oct 2000 23:37:03 +0000 Subject: Update and simplification. --- libc/string/strspn.c | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) (limited to 'libc/string/strspn.c') 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; } -- cgit v1.2.3