aboutsummaryrefslogtreecommitdiff
path: root/lib/compat/strchrnul.c
blob: 7296060ae7f8382fefd73dce23bd537f84d4189f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* SPDX-License-Identifier: LGPL-3.0-or-later */
/*
 * strchrnul.c
 *
 * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
 */
#include "config.h"
#include "compat.h"

#ifndef HAVE_STRCHRNUL
char *strchrnul(const char *s, int c)
{
	while (*s && *((unsigned char *)s) != c)
		++s;

	return (char *)s;
}
#endif