-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strncat.c
More file actions
29 lines (26 loc) · 1.11 KB
/
ft_strncat.c
File metadata and controls
29 lines (26 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tparand <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/10 16:46:07 by tparand #+# #+# */
/* Updated: 2017/11/11 20:17:22 by tparand ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *dest, const char *src, size_t n)
{
char *p_dest;
p_dest = dest;
while (*p_dest != '\0')
p_dest++;
while (n > 0 && *src != '\0')
{
*p_dest++ = *src++;
n--;
}
*p_dest = '\0';
return (dest);
}