-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
29 lines (26 loc) · 1.08 KB
/
ft_strchr.c
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
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edelangh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/04 15:37:41 by edelangh #+# #+# */
/* Updated: 2014/11/10 11:37:00 by edelangh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
char *s1;
s1 = (char*)s;
while (*s1)
{
if ((*s1) == (char)c)
return (s1);
++s1;
}
if ((*s1) == (char)c)
return (s1);
return (NULL);
}