summaryrefslogtreecommitdiff
path: root/lib/libc/string/strpbrk.c
blob: a03bb31a0f0ec33476e74592f7264c73550083a3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <stddef.h> // for NULL

char *strpbrk(const char *s1, const char *s2)
{
	while (*s1 != '\0') {
		const char *p = s2;
		while (*p != '\0') {
			if (*s1 == *p)
				return (char *)s1;
			p++;
		}
		s1++;
	}

	return NULL;
}