correct different arg names in linux and bsd man pages

This commit is contained in:
Khaïs COLIN 2024-10-15 14:44:11 +02:00
parent b86949e284
commit 29fbed55a3
5 changed files with 31 additions and 30 deletions

View file

@ -6,13 +6,13 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 11:28:05 by kcolin #+# #+# */ /* Created: 2024/10/15 11:28:05 by kcolin #+# #+# */
/* Updated: 2024/10/15 14:13:29 by kcolin ### ########.fr */ /* Updated: 2024/10/15 14:41:45 by kcolin ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "libft.h" #include "libft.h"
void ft_bzero(void *b, t_size len) void ft_bzero(void *s, t_size n)
{ {
ft_memset(b, 0, len); ft_memset(s, 0, n);
} }

View file

@ -6,21 +6,21 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 13:38:05 by kcolin #+# #+# */ /* Created: 2024/10/15 13:38:05 by kcolin #+# #+# */
/* Updated: 2024/10/15 13:42:29 by kcolin ### ########.fr */ /* Updated: 2024/10/15 14:40:24 by kcolin ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "libft.h" #include "libft.h"
void *ft_memcpy(void *dst, const void *src, t_size len) void *ft_memcpy(void *dest, const void *src, t_size n)
{ {
t_size i; t_size i;
i = 0; i = 0;
while (i < len) while (i < n)
{ {
((char *)dst)[i] = ((char *)src)[i]; ((char *)dest)[i] = ((char *)src)[i];
i++; i++;
} }
return (dst); return (dest);
} }

View file

@ -6,41 +6,41 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 13:57:12 by kcolin #+# #+# */ /* Created: 2024/10/15 13:57:12 by kcolin #+# #+# */
/* Updated: 2024/10/15 14:12:15 by kcolin ### ########.fr */ /* Updated: 2024/10/15 14:39:52 by kcolin ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "libft.h" #include "libft.h"
/* /*
* case 1: dst overlaps at start of src. * case 1: dest overlaps at start of src.
* src is before dst. * src is before dest.
* copy back to front * copy back to front
* *
* case 2: dst overlaps at beginning of src. * case 2: dest overlaps at beginning of src.
* src is after dst. * src is after dest.
* copy front to back. * copy front to back.
* *
* case 3: dst and src do not overlap * case 3: dest and src do not overlap
* it doesn't matter how the data is copied * it doesn't matter how the data is copied
* merge with case 2 * merge with case 2
*/ */
void *ft_memmove(void *dst, const void *src, t_size len) void *ft_memmove(void *dest, const void *src, t_size n)
{ {
t_size i; t_size i;
if (dst >= src && dst <= (src + len)) if (dest >= src && dest <= (src + n))
{ {
i = len; i = n;
while (i > 0) while (i > 0)
{ {
i--; i--;
((char *)dst)[i] = ((char *)src)[i]; ((char *)dest)[i] = ((char *)src)[i];
} }
} }
else else
{ {
ft_memcpy(dst, src, len); ft_memcpy(dest, src, n);
} }
return (dst); return (dest);
} }

View file

@ -6,21 +6,21 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 10:46:44 by kcolin #+# #+# */ /* Created: 2024/10/15 10:46:44 by kcolin #+# #+# */
/* Updated: 2024/10/15 10:58:03 by kcolin ### ########.fr */ /* Updated: 2024/10/15 14:42:49 by kcolin ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
#include "libft.h" #include "libft.h"
void *ft_memset(void *dest, int c, t_size len) void *ft_memset(void *s, int c, t_size n)
{ {
t_size i; t_size i;
i = 0; i = 0;
while (i < len) while (i < n)
{ {
*((unsigned char *)dest + i) = (unsigned char)c; *((unsigned char *)s + i) = (unsigned char)c;
i++; i++;
} }
return (dest); return (s);
} }

11
libft.h
View file

@ -6,7 +6,7 @@
/* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */ /* By: kcolin <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/15 10:11:54 by kcolin #+# #+# */ /* Created: 2024/10/15 10:11:54 by kcolin #+# #+# */
/* Updated: 2024/10/15 13:56:53 by kcolin ### ########.fr */ /* Updated: 2024/10/15 14:42:16 by kcolin ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -23,9 +23,10 @@ int ft_isprint(int c);
t_size ft_strlen(const char *s); t_size ft_strlen(const char *s);
void *ft_memset(void *dest, int c, t_size len); void *ft_memset(void *s, int c, t_size n);
void ft_bzero(void *b, t_size len); void ft_bzero(void *s, t_size n);
void *ft_memcpy(void *dst, const void *src, t_size len); void *ft_memcpy(void *dest, const void *src, t_size n);
void *ft_memmove(void *dst, const void *src, t_size len); void *ft_memmove(void *dest, const void *src, t_size n);
t_size ft_strlcpy(char *dst, const char *src, t_size size);
#endif #endif