libc/string/lib_strrchr.c
/* The strrchr() function returns a pointer to the last
 * occurrence of the character c in the string s.
 */
The strrchr() function returns a pointer to the last
occurrence of the character c in the string s.
The strrchr () function returns a pointer to the last occurrence of the character c in the string s .
char *strrchr(const char *s, int c)
{
  if (s)
    {
      const char *p = &s[strlen(s) - 1];
      for (; p >= s; p--)
        {
          if (*p == c)
            {
              return (char*)p;
            }
        }
    }
  return NULL;
}
char * strrchr ( const char * s , int c ) { if ( s ) { const char * p = & s [ strlen ( s ) - 1 ] ; for ( ; p >= s ; p -- ) { if ( * p == c ) { return ( char * ) p ; } } } return NULL ; }
The strrchr() function returns a pointer to the last
 occurrence of the character c in the string s.
The strrchr () function returns a pointer to the last occurrence of the character c in the string s .