summaryrefslogtreecommitdiff
path: root/src/string/strchr.c
blob: 2ee80c9bd388123bd93b238d7b78d44d7805c290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <string.h>
#include "../_assert.h"

/** string search **/
char * strchr(const char *s, int c)
{
	ASSERT_NONNULL(s);

	/*
	RETURN_FAILURE(CONSTANT(NULL));
	RETURN_SUCCESS(a pointer to the located character);
	*/
	return (char*)memchr(s, (char)c, strlen(s));
}

/***
searches the string ARGUMENT(s) for the first occurrence of
ARGUMENT(c) (converted to a TYPE(char)).
***/
/*
STDC(1)
*/