Add all git folders
This commit is contained in:
29
C_Piscine_C_03/git/ex03/ft_strncat.c
Normal file
29
C_Piscine_C_03/git/ex03/ft_strncat.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strncat.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: gbaconni <marvin@42lausanne.ch> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/08/12 16:43:59 by gbaconni #+# #+# */
|
||||
/* Updated: 2021/08/12 16:47:35 by gbaconni ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
char *ft_strncat(char *dest, char *src, unsigned int nb)
|
||||
{
|
||||
char *s1;
|
||||
char *s2;
|
||||
|
||||
s1 = dest;
|
||||
s2 = src;
|
||||
while (*s1 != '\0')
|
||||
s1++;
|
||||
while (nb > 0 && *s2 != '\0')
|
||||
{
|
||||
*s1++ = *s2++;
|
||||
nb--;
|
||||
}
|
||||
*s1 = '\0';
|
||||
return (dest);
|
||||
}
|
||||
Reference in New Issue
Block a user