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