-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strncpy.c
28 lines (25 loc) · 1.08 KB
/
ft_strncpy.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
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* vt_strncpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ewilliam <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/29 15:57:52 by ewilliam #+# #+# */
/* Updated: 2016/12/01 14:41:26 by ewilliam ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strncpy(char *dst, const char *src, size_t len)
{
char *odest;
odest = dst;
while (len && *src)
{
*dst++ = *src++;
len--;
}
while (len--)
*dst++ = '\0';
return (odest);
}