minishell/libft/srcs/ft_strchr.c
Tanguy MAZE cf62dae53b norm: splitted functions in main into appropriate file
Moved lstdelenvelem & env2lst to ms_env.c
Normed out files
2019-09-20 12:06:44 +02:00

30 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/04 18:54:17 by tmaze #+# #+# */
/* Updated: 2018/05/16 15:09:08 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strchr(const char *s, int c)
{
int i;
char *tmp;
if (s != NULL)
{
i = -1;
tmp = (char*)s;
while (++i == 0 || tmp[i - 1])
if (tmp[i] == c)
return (&tmp[i]);
}
return (NULL);
}