Archived
1
0
This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
so_long/libft/ft_strchr.c

26 lines
1.1 KiB
C
Raw Normal View History

2024-01-13 19:13:17 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/01 15:45:18 by adjoly #+# #+# */
/* Updated: 2023/11/09 14:31:55 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
size_t len_s;
char *result;
len_s = ft_strlen(s);
result = ft_memchr(s, c, len_s);
if (c == 0)
return ((char *)s + len_s);
return (result);
}