]> pd.if.org Git - pdclib/blob - functions/string/strchr.c
ec296cbce33cab48ae8b9aeaa6fed4500710c83b
[pdclib] / functions / string / strchr.c
1 /* $Id$ */
2
3 /* Release $Name$ */
4
5 /* strchr( const char *, int )
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 * strchr( const char * s, int c )
14 {
15     do
16     {
17         if ( *s == (char) c )
18         {
19             return (char *) s;
20         }
21     } while ( *s++ );
22     return NULL;
23 }
24
25 #warning Test driver missing.
26
27 #ifdef TEST
28 int main()
29 {
30     return 0;
31 }
32 #endif