-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strncpy.c
executable file
·26 lines (23 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strncpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ioleksiu <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/01 20:11:11 by ioleksiu #+# #+# */
/* Updated: 2016/12/27 20:20:33 by ioleksiu ### ########.fr */
/* */
/* ************************************************************************** */
#include "lem_in.h"
char *ft_strncpy(char *dst, const char *src, size_t len)
{
size_t a;
a = -1;
while (++a < len && src[a])
dst[a] = src[a];
a = a - 1;
while (++a < len)
dst[a] = '\0';
return (dst);
}