]> pd.if.org Git - pdclib/blobdiff - functions/string/strchr.c
Added some of <string.h>.
[pdclib] / functions / string / strchr.c
diff --git a/functions/string/strchr.c b/functions/string/strchr.c
new file mode 100644 (file)
index 0000000..ced1d55
--- /dev/null
@@ -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 <string.h>
+
+char * strchr( const char * s, int c )
+{
+    do
+    {
+        if ( *s == (char) c )
+        {
+            return (char *) s;
+        }
+    } while ( *s++ );
+    return NULL;
+}