42_C_PISCINE/C/c02v2/ex01/ft_strncpy.c
Camille Chauvet 29ed24d567 init
2023-05-17 16:45:25 +00:00

27 lines
1.0 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/16 15:08:22 by cchauvet #+# #+# */
/* Updated: 2022/07/24 11:29:29 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strncpy(char *dest, char *src, unsigned int n)
{
unsigned int i;
i = 0;
while (*src != '\0' || i < n)
{
*dest = *src;
src++;
dest++;
i++;
}
return (dest);
}