30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strncat.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2022/07/18 19:02:00 by cchauvet #+# #+# */
|
|
/* Updated: 2022/07/21 13:00:52 by cchauvet ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
char *ft_strncat(char *dest, char *src, unsigned int nb)
|
|
{
|
|
int i;
|
|
int j;
|
|
|
|
i = 0;
|
|
while (dest[i] != 0)
|
|
i++;
|
|
j = 0;
|
|
while (src[j] != 0 && j < nb)
|
|
{
|
|
dest[i + j] = src[j];
|
|
j++;
|
|
}
|
|
dest[i + j] = 0;
|
|
return (dest);
|
|
}
|