ft_strchr, norming ft_strcpy, ft_strncat, ft_strncpy

This commit is contained in:
Tanguy MAZE
2018-04-04 19:22:29 +02:00
parent 727ec54307
commit 698a37b399
5 changed files with 31 additions and 8 deletions

24
ft_strchr.c Normal file
View 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);
}