summary refs log tree commit diff
path: root/string/strpbrk.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/strpbrk.c')
-rw-r--r--string/strpbrk.c12
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)