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