-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
31 lines (28 loc) · 1.1 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
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vpopovyc <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/23 14:22:59 by vpopovyc #+# #+# */
/* Updated: 2016/12/02 14:56:58 by vpopovyc ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/libft.h"
char *ft_strchr(const char *s, int c)
{
char *beer;
int beer2;
beer2 = (int)ft_strlen(s);
while (beer2-- >= 0)
{
if (*s == c)
{
beer = (char*)s;
return (beer);
}
s++;
}
return (NULL);
}