-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_memcpy_bwd.c
27 lines (24 loc) · 1.1 KB
/
ft_memcpy_bwd.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_memcpy_bwd.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: msaliuta <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/30 18:33:21 by msaliuta #+# #+# */
/* Updated: 2018/11/04 12:46:32 by msaliuta ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
void *ft_memcpy_bwd(void *dst, const void *src, size_t n)
{
char *s1;
char *s2;
if (n == 0 || dst == src)
return (dst);
s1 = (char *)dst;
s2 = (char *)src;
while (n--)
s1[n] = s2[n];
return (s1);
}