/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strndup.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: bchanot +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/12/19 19:32:15 by bchanot #+# #+# */ /* Updated: 2018/10/13 22:48:31 by bchanot ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strndup(const char *src, int n) { char *new; if (!(new = ft_strnew(n))) return (NULL); ft_memcpy(new, src, n); return (new); }