-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strchr.c
23 lines (21 loc) · 1.03 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: dbrophy <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/18 13:37:55 by dbrophy #+# #+# */
/* Updated: 2020/02/18 13:37:55 by dbrophy ### ########.fr */
/* */
/* ************************************************************************** */
#include "stdlib.h"
char *ft_strchr(char *s, int c)
{
if (s == NULL)
return (NULL);
while (*s != (char)c)
if (*(s++) == 0)
return (NULL);
return (s);
}