/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strdup.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/23 14:55:16 by bchanot #+# #+# */ /* Updated: 2018/10/13 21:20:06 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strdup(const char *src) { char *s; if (!src) return (NULL); if (!(s = ft_strnew(ft_strlen(src)))) return (NULL); ft_strcpy(s, src); return (s); }