blob: 45eecdd6bff02ad531d268b94d6aa611a70c3c98 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/10/07 10:14:47 by cacharle #+# #+# */
/* Updated: 2019/10/20 13:10:19 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include <stdlib.h>
char *ft_strchr(const char *s, int c)
{
while (*s)
{
if (*s == (char)c)
return ((char*)s);
s++;
}
if ((char)c == 0)
return ((char*)s);
return (NULL);
}
|