summaryrefslogtreecommitdiffstats
path: root/replace/strchrnul.c
blob: d1be6df8a82cf7a4f25b48ad1e8d8bbd6cda5332 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <crm_internal.h>
/* Borrowed from gnulib's strchrnul.c under GLPv2+ */

#include <string.h>
/* Find the first occurrence of C in S or the final NUL byte.  */
char *
strchrnul(const char *s, int c_in)
{
    char c = c_in;

    while (*s && (*s != c))
        s++;

    return (char *)s;
}