WvStreams
strchrnul.c
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 *s, int c)
15 {
16  const char *p = s;
17  while (*p && (*p != c))
18  p++;
19 
20  return (char *) p;
21 }