xref: /haiku/src/system/libroot/posix/string/strpbrk.c (revision 5af32e752606778be5dd7379f319fe43cb3f6b8c)
1 /*
2 ** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3 ** Distributed under the terms of the NewOS License.
4 */
5 
6 #include <sys/types.h>
7 #include <string.h>
8 
9 
10 char *
strpbrk(char const * cs,char const * ct)11 strpbrk(char const *cs, char const *ct)
12 {
13 	const char *sc1;
14 	const char *sc2;
15 
16 	for (sc1 = cs; *sc1 != '\0'; ++sc1) {
17 		for (sc2 = ct; *sc2 != '\0'; ++sc2) {
18 			if (*sc1 == *sc2)
19 				return (char *)sc1;
20 		}
21 	}
22 
23 	return NULL;
24 }
25