1 /* strchrnul.c
2 *
3 */
4
5 /* Written by Niels M�ller <nisse@lysator.liu.se>
6 *
7 * This file is hereby placed in the public domain.
8 */
9
10 /* FIXME: What is this function supposed to do? My guess is that it is
11 * like strchr, but returns a pointer to the NUL character, not a NULL
12 * pointer, if the character isn't found. */
13
14 char *strchrnul(const char *, int );
15
strchrnul(const char * s,int c)16 char *strchrnul(const char *s, int c)
17 {
18 const char *p = s;
19 while (*p && (*p != c))
20 p++;
21
22 return (char *) p;
23 }
24