-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
23 lines (21 loc) · 1.05 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: alalaoui <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/04/17 17:35:39 by alalaoui #+# #+# */
/* Updated: 2017/04/17 18:04:20 by alalaoui ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
#include <stdlib.h>
char *ft_strchr(const char *s, int c)
{
while (*s != '\0' && *s != (char)c)
s++;
if (*s == (char)c)
return ((char*)s);
return (NULL);
}