-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
edimarc
committed
Nov 8, 2024
1 parent
132dfde
commit 66538ae
Showing
2 changed files
with
14 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,27 +6,30 @@ | |
/* By: emdi-mar <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/09/09 20:50:58 by emdi-mar #+# #+# */ | ||
/* Updated: 2024/09/25 21:49:02 by emdi-mar ### ########.fr */ | ||
/* Updated: 2024/11/08 17:04:17 by emdi-mar ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include "libft.h" | ||
|
||
void *ft_memmove(void *dst, const void *src, size_t len) | ||
void *ft_memmove(void *dst, const void *src, size_t n) | ||
{ | ||
size_t i; | ||
int i; | ||
|
||
i = 0; | ||
if (src == NULL || dst == NULL) | ||
return (NULL); | ||
if ((size_t)dst > (size_t)src) | ||
if (!src || !dst || n == 0) | ||
return (dst); | ||
if (dst > src) | ||
{ | ||
while (len-- > 0) | ||
((unsigned char *)dst)[len] = ((unsigned char *)src)[len]; | ||
i = (int)n; | ||
while (i-- > 0) | ||
{ | ||
((unsigned char *)dst)[i] = ((unsigned char *)src)[i]; | ||
} | ||
} | ||
else | ||
{ | ||
while (i < len) | ||
while ((size_t)i < n) | ||
{ | ||
((unsigned char *)dst)[i] = ((unsigned char *)src)[i]; | ||
i++; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: emdi-mar <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/05/28 23:52:19 by emdi-mar #+# #+# */ | ||
/* Updated: 2024/09/09 20:52:37 by emdi-mar ### ########.fr */ | ||
/* Updated: 2024/11/08 13:07:07 by emdi-mar ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -32,7 +32,7 @@ size_t ft_strlen(const char *s); | |
void ft_bzero(void *s, size_t n); | ||
void *ft_memcpy(void *dst, const void *src, size_t n); | ||
//void *ft_memccpy(void *dst, const void *src, int c, size_t n); | ||
void *ft_memmove(void *dst, const void *src, size_t len); | ||
void *ft_memmove(void *dst, const void *src, size_t n); | ||
//int ft_memcmp(const void *s1, const void *s2, size_t n); | ||
//size_t ft_strlcpy(char *dst, const char *src, size_t dstsize); | ||
//size_t ft_strlcat(char *dst, const char *src, size_t dstsize); | ||
|