ft_strchr, norming ft_strcpy, ft_strncat, ft_strncpy
This commit is contained in:
24
ft_strchr.c
Normal file
24
ft_strchr.c
Normal file
@@ -0,0 +1,24 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strchr.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2018/04/04 18:54:17 by tmaze #+# #+# */
|
||||
/* Updated: 2018/04/04 19:15:12 by tmaze ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "libft.h"
|
||||
|
||||
char *ft_strchr(const char *s, int c)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = -1;
|
||||
while (++i == 0 || s[i - 1])
|
||||
if (s[i] == c)
|
||||
return (strdup(&s[i]));
|
||||
return (NULL);
|
||||
}
|
Reference in New Issue
Block a user