1 /* strrchr( const char *, int c )
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 * strrchr( const char * s, int c )
17 if ( s[--i] == (char) c )
19 return (char *) s + i;
28 #include "_PDCLIB_test.h"
32 char abccd[] = "abccd";
33 TESTCASE( strrchr( abcde, '\0' ) == &abcde[5] );
34 TESTCASE( strrchr( abcde, 'e' ) == &abcde[4] );
35 TESTCASE( strrchr( abcde, 'a' ) == &abcde[0] );
36 TESTCASE( strrchr( abccd, 'c' ) == &abccd[3] );