s/putc_unlocked/putc/g for freebsd on alpha
[gsasl.git] / argp / strchrnul.c
blobaf1b4bbb9165e3c1ae187b3cf50588816921861f
1 /* strchrnul.c
3 */
5 /* Written by Niels Möller <nisse@lysator.liu.se>
7 * This file is hereby placed in the public domain.
8 */
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. */
14 char *strchrnul(const char *s, int c)
16 const char *p = s;
17 while (*p && (*p != c))
18 p++;
20 return (char *) p;