-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strcpy.c
36 lines (33 loc) · 1.21 KB
/
ft_strcpy.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
29
30
31
32
33
34
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcpy.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rodrodri <[email protected] > +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/29 11:26:52 by rodrodri #+# #+# */
/* Updated: 2021/11/10 21:55:16 by rodrodri ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strcpy(char *dst, const char *src)
{
ft_memcpy(dst, src, ft_strlen(src));
ft_bzero(dst + ft_strlen(src), 1);
return (dst);
}
/*
** The old basecamp way, when we couln't reuse code...
**{
** int i;
**
** i = 0;
** while (src[i])
** {
** dst[i] = src[i];
** i++;
** }
** dst[i] = src[i];
** return (dst);
**}
*/