]> pd.if.org Git - pdclib/blob - functions/string/strpbrk.c
Re-import from Subversion.
[pdclib] / functions / string / strpbrk.c
1 /* ----------------------------------------------------------------------------
2  * $Id$
3  * ----------------------------------------------------------------------------
4  * Public Domain C Library - http://pdclib.sourceforge.net
5  * This code is Public Domain. Use, modify, and redistribute at will.
6  * --------------------------------------------------------------------------*/
7
8 #include <__NULL.h>
9
10 char * strpbrk( const char *src_1, const char * src_2 )
11 {
12     const char * p1 = src_1;
13     const char * p2;
14     while ( *p1 != '\0' )
15     {
16         p2 = src_2;
17         while ( *p2 != '\0' )
18         {
19             if ( *p1 == *p2++ )
20             {
21                 return (char *) p1;
22             }
23         }
24         ++p1;
25     }
26     return NULL;
27 }