-
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: solariscode <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/01/24 05:08:30 by melkholy #+# #+# */
/* Updated: 2022/02/13 05:44:21 by melkholy ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *str, int c)
{
while (*str && *str != (unsigned char)c)
str ++;
if (*str == (unsigned char)c)
return ((char *)str);
return (NULL);
}