-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathft_strncat.c
26 lines (23 loc) · 1.08 KB
/
ft_strncat.c
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vbrazas <vbrazas@student.unit.ua> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/11/05 19:35:56 by vbrazas #+# #+# */
/* Updated: 2017/11/12 18:25:22 by vbrazas ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncat(char *dest, const char *src, size_t n)
{
size_t i;
size_t j;
i = ft_strlen(dest);
j = 0;
while (src[j] && j < n)
dest[i++] = src[j++];
dest[i] = '\0';
return (dest);
}