ft_strcat, ft_strncat

This commit is contained in:
Tanguy MAZE
2018-04-04 18:49:01 +02:00
parent 625255c864
commit 727ec54307
4 changed files with 49 additions and 3 deletions

22
ft_strncat.c Normal file
View File

@@ -0,0 +1,22 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmaze <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/04/04 18:29:06 by tmaze #+# #+# */
/* Updated: 2018/04/04 18:34:17 by tmaze ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *restrict dest, const char *src, size_t n)
{
int dest_len;
dest_len = ft_strlen(dest);
ft_strncpy(&dest[dest_len], src, n);
return (dest);
}