X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fstrpbrk.c;fp=functions%2Fstring%2Fstrpbrk.c;h=8926cc8e00c76cbbd9e77476b357b09fb84ae738;hb=d35060079d924391f4c36ab8b859bbfd7bb38ffe;hp=0000000000000000000000000000000000000000;hpb=152fbc0b4bdc5362c8d65c3cdac3bd68040be599;p=pdclib diff --git a/functions/string/strpbrk.c b/functions/string/strpbrk.c new file mode 100644 index 0000000..8926cc8 --- /dev/null +++ b/functions/string/strpbrk.c @@ -0,0 +1,30 @@ +/* $Id$ */ + +/* Release $Name$ */ + +/* strpbrk( const char *, const char * ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include + +char * strpbrk( const char * s1, const char * s2 ) +{ + const char * p1 = s1; + const char * p2; + while ( *p1 ) + { + p2 = s2; + while ( *p2 ) + { + if ( *p1 == *p2++ ) + { + return (char *) p1; + } + } + ++p1; + } + return NULL; +}