diff options
Diffstat (limited to 'string/strpbrk.c')
-rw-r--r-- | string/strpbrk.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/string/strpbrk.c b/string/strpbrk.c index fddd473ad7..1ede71994f 100644 --- a/string/strpbrk.c +++ b/string/strpbrk.c @@ -27,15 +27,7 @@ char * STRPBRK (const char *s, const char *accept) { - while (*s != '\0') - { - const char *a = accept; - while (*a != '\0') - if (*a++ == *s) - return (char *) s; - ++s; - } - - return NULL; + s += strcspn (s, accept); + return *s ? (char *)s : NULL; } libc_hidden_builtin_def (strpbrk) |