mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 19:36:50 +01:00
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strchr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: mmoussou <mmoussou@student.42angoulem +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/11/01 22:01:50 by mmoussou #+# #+# */
|
|
/* Updated: 2023/11/13 19:39:47 by mmoussou ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "libft.h"
|
|
|
|
char *ft_strchr(const char *s, int c)
|
|
{
|
|
size_t i;
|
|
|
|
i = 0;
|
|
if (!s)
|
|
return (NULL);
|
|
while (s[i])
|
|
{
|
|
if (s[i] == (unsigned char)c)
|
|
return (&((char *)s)[i]);
|
|
i++;
|
|
}
|
|
if (!c)
|
|
return (&((char *)s)[i]);
|
|
return (NULL);
|
|
}
|