]> pd.if.org Git - pdclib/blob - functions/string/strrchr.c
Test-compile fixes.
[pdclib] / functions / string / strrchr.c
1 /* $Id$ */
2
3 /* Release $Name$ */
4
5 /* strrchr( const char *, int c )
6
7    This file is part of the Public Domain C Library (PDCLib).
8    Permission is granted to use, modify, and / or redistribute at will.
9 */
10
11 #include <string.h>
12
13 char * strrchr( const char * s, int c )
14 {
15     size_t i = 0;
16     while ( s[i++] );
17     do
18     {
19         if ( s[--i] == (char) c )
20         {
21             return (char *) s + i;
22         }
23     } while ( i );
24     return NULL;
25 }
26
27 #warning Test driver missing.