32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* ft_strncat.c :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: ajoly <marvin@42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2022/07/22 09:49:37 by ajoly #+# #+# */
|
||
|
/* Updated: 2022/07/22 09:49:45 by ajoly ### ########.fr */
|
||
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
char *ft_strncat(char *dest, char *src, unsigned int nb)
|
||
|
{
|
||
|
unsigned int i;
|
||
|
unsigned int l;
|
||
|
|
||
|
i = 0;
|
||
|
l = 0;
|
||
|
while (dest[i] != '\0')
|
||
|
{
|
||
|
i++;
|
||
|
}
|
||
|
while (src[l] != '\0' && l < nb)
|
||
|
{
|
||
|
dest[i + l] = src[l];
|
||
|
l++;
|
||
|
}
|
||
|
dest[i + l] = '\0';
|
||
|
return (dest);
|
||
|
}
|