/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strncpy.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: scebula +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2015/11/24 21:13:38 by scebula #+# #+# */ /* Updated: 2015/12/04 00:30:48 by scebula ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strncpy(char *dst, const char *src, size_t n) { size_t i; i = 0; while (src[i] && i < n) { dst[i] = src[i]; i++; } while (i < n) { dst[i] = '\0'; i++; } return (dst); }