summaryrefslogtreecommitdiff
path: root/lib/string/strpbrk.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/string/strpbrk.c')
-rw-r--r--lib/string/strpbrk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/string/strpbrk.c b/lib/string/strpbrk.c
new file mode 100644
index 0000000..82fbc92
--- /dev/null
+++ b/lib/string/strpbrk.c
@@ -0,0 +1,10 @@
+/* SPDX-License-Identifier: MIT */
+/* Derived from musl libc (Copyright © 2005-2020 Rich Felker, et al.) */
+
+#include <string.h>
+
+char *strpbrk(const char *s, const char *b)
+{
+ s += strcspn(s, b);
+ return *s ? (char *)s : 0;
+}