42-archive/fillit/lib/libft/ft_strncat.c
Jack Halford 3d1bba5039 libft
2016-08-28 18:13:44 +02:00

29 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/08/07 10:57:07 by jhalford #+# #+# */
/* Updated: 2016/08/07 10:57:11 by jhalford ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *s1, const char *s2, size_t n)
{
size_t size;;
size_t j;
size = ft_strlen(s1);
j = 0;
while (s2[j] != '\0' && j < n)
{
s1[size + j] = s2[j];
j++;
}
s1[size + j] = '\0';
return (s1);
}