norm: splitted functions in main into appropriate file
Moved lstdelenvelem & env2lst to ms_env.c Normed out files
This commit is contained in:
29
libft/srcs/ft_strchr.c
Normal file
29
libft/srcs/ft_strchr.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* 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);
|
||||
}
|
Reference in New Issue
Block a user