Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / string / strpbrk.c
blobd98474564301324211dcf0473e8e24b548a3cc4a
1 /*
2 FUNCTION
3 <<strpbrk>>---find characters in string
5 INDEX
6 strpbrk
8 SYNOPSIS
9 #include <string.h>
10 char *strpbrk(const char *<[s1]>, const char *<[s2]>);
12 DESCRIPTION
13 This function locates the first occurence in the string
14 pointed to by <[s1]> of any character in string pointed to by
15 <[s2]> (excluding the terminating null character).
17 RETURNS
18 <<strpbrk>> returns a pointer to the character found in <[s1]>, or a
19 null pointer if no character from <[s2]> occurs in <[s1]>.
21 PORTABILITY
22 <<strpbrk>> requires no supporting OS subroutines.
25 #include <string.h>
27 char *
28 strpbrk (const char *s1,
29 const char *s2)
31 const char *c = s2;
33 while (*s1)
35 for (c = s2; *c; c++)
37 if (*s1 == *c)
38 return (char *) s1;
40 s1++;
43 return (char *) NULL;