X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstring%2Fstrchr.c;fp=functions%2Fstring%2Fstrchr.c;h=ced1d552154e5a49eab4582fc8edd2ef08e2f601;hp=0000000000000000000000000000000000000000;hb=c2f1367984ba4153d892062759c3813020b65a9a;hpb=3220f577b186e04180acd7554a785c60dfb7ebb2 diff --git a/functions/string/strchr.c b/functions/string/strchr.c new file mode 100644 index 0000000..ced1d55 --- /dev/null +++ b/functions/string/strchr.c @@ -0,0 +1,23 @@ +/* $Id$ */ + +/* Release $Name$ */ + +/* strchr( const char *, int ) + + This file is part of the Public Domain C Library (PDCLib). + Permission is granted to use, modify, and / or redistribute at will. +*/ + +#include + +char * strchr( const char * s, int c ) +{ + do + { + if ( *s == (char) c ) + { + return (char *) s; + } + } while ( *s++ ); + return NULL; +}