You've mostly got it.
Each C 'string' ends in a character value of 0. That's what your "out of bounds" is really checking, really it's "end of string.
Commented (and formatted properly)
int find_ substr( char *s1, char *s2)
{
register int t;
char *p, *p2;
for( t= 0; s1[t]; t++) // Move character by character thru the source string
// start at the first character t=0 and s1[t]
// until the current character s1[t] is 0 (FALSE)
{
p = &s1[t]; // p becomes the address of the current character
p2 = s2; // p2 becomes the search string
// Following tests to see if the current position in the source string and the seach string
// matches...
while (*p2 && // Continue while *p2 is not 0 (TRUE) -- end of string not found
*p2 == *p) // and source and search characters are identical
{
p++; // skip to the next character
p2++; // in both strings
}
if (!*p2) return t; // out of loop -- if the current character in the seach string
// is 0, we have a match. Return the substript of the start
// of the sub-string
}
return -1; // substring not found
}