You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: frdescam <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/06/07 15:59:51 by frdescam #+# #+# */
/* Updated: 2019/06/11 15:16:48 by frdescam ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strncat(char *dest, char *src, unsigned int nb)
{
int i;
unsigned int j;
i = 0;
while (dest[i])
{
i++;
}
j = 0;
while (src[j] && j < nb)
{
dest[i] = src[j];
i++;
j++;
}
dest[i] = '\0';
return (dest);
}