-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strlcpy.c
More file actions
29 lines (26 loc) · 1.14 KB
/
Copy pathft_strlcpy.c
File metadata and controls
29 lines (26 loc) · 1.14 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_strlcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: zmoumen <zmoumen@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/07 16:05:56 by zmoumen #+# #+# */
/* Updated: 2022/10/07 17:09:40 by zmoumen ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_strlcpy(char *dst, const char *src, size_t dstsize)
{
size_t step;
step = 0;
if (!dstsize)
return (ft_strlen(src));
while (step < dstsize - 1 && src[step])
{
dst[step] = src[step];
step++;
}
dst[step] = 0;
return (ft_strlen(src));
}