const char* mstrstr(const char* srcstr,const char* findstr)
{
int index = 0;
assert((index = strlen(findstr) - 1) <= (strlen(srcstr) - 1));
for(i = 0,j = index;srcstr[i] != 0;)
{
if(findstr[j] == srcstr[i + j])
{
if(j == 0)
{
return &srcstr[i + j];
}
--j;
}
else
{
for(;findstr[j] != srcstr[i + j];++i)
{
if(srcstr[i + j] == 0)
return NULL;
}
j = index;
}
}
return NULL;
}