xref: /haiku/src/system/libroot/posix/string/strchr.c (revision c90684742e7361651849be4116d0e5de3a817194)
1 /*
2  * Copyright 2001, Travis Geiselbrecht. All rights reserved.
3  * Distributed under the terms of the NewOS License.
4  */
5 
6 
7 #include <sys/types.h>
8 #include <string.h>
9 
10 
11 char*
12 strchr(const char* s, int c)
13 {
14 	for (; *s != (char)c; ++s)
15 		if (*s == '\0')
16 			return NULL;
17 	return (char*)s;
18 }
19 
20 
21 char*
22 index(const char* s, int c)
23 {
24 	return strchr(s, c);
25 }
26