3 /* strstr( const char *, const char * )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 char * strstr( const char * s1, const char * s2 )
20 while ( *p2 && ( *p1 == *p2 ) )
38 #include <_PDCLIB_test.h>
42 char s[] = "abcabcabcdabcde";
43 TESTCASE( strstr( s, "x" ) == NULL );
44 TESTCASE( strstr( s, "xyz" ) == NULL );
45 TESTCASE( strstr( s, "a" ) == &s[0] );
46 TESTCASE( strstr( s, "abc" ) == &s[0] );
47 TESTCASE( strstr( s, "abcd" ) == &s[6] );
48 TESTCASE( strstr( s, "abcde" ) == &s[10] );