-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strchr.c
22 lines (20 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: lpires-n <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/06/02 17:06:01 by lpires-n #+# #+# */
/* Updated: 2022/06/03 17:24:15 by lpires-n ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
while (*s != '\0' && *s != (unsigned char)c)
s++;
if ((unsigned char)c == *s)
return ((char *)s);
return (NULL);
}