Determine if the haystack string contains the needle string

Return TypeFunction nameArguments
int32_tCstrLast(const char*,const char*,)

Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp

Function Logic:

0:START 1:- 2:unknown 3:Return -1 4:unknown 5:unknown 6:unknown 7:posn 8:Return posn

Function body:

int32_t CstrLast (const char* cpHaystack)const char* cpNeedle, 
{
   //  Category: Text Processing
   //  
   //  Determine if the haystack string contains the needle string
   //  
   //  Arguments: 1) cpHaystack The source string
   //     2) cpNeedle The being sought
   //  
   //  Returns: True If the needle string occurs in the haystack string
   //     False Otherwise
   int32_t n ;             //  String iterator (position)
   int32_t posn = -1;      //  Last position needle found
   if (!cpHaystack || !cpHaystack[0]|| !cpNeedle || !cpNeedle[0])
       return -1;
   for (n = 0; cpHaystack[n] ; n++)
   {
       if (cpHaystack[n] != cpNeedle[0])
           continue ;
       if (!CstrCompare(cpHaystack + n, cpNeedle))
           posn = n ;
   }
   return posn ;
}