/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strncpy.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/08/07 10:48:21 by jhalford #+# #+# */ /* Updated: 2016/08/07 10:48:25 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ char *ft_strncpy(char *dest, char *src, unsigned int n) { int i; i = 0; while (src[i] != '\0' && i < (int)n) { dest[i] = src[i]; i++; } while (i < (int)n) { dest[i] = '\0'; i++; } return (dest); }