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