aboutsummaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-02 14:19:07 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-02 14:19:07 +0200
commitad33f31d00cdf5593baa83b63eb5445ef2951250 (patch)
tree25f36a8c9f4e4772b75b2773f27166d6e3084675 /src/mem
parent5d2f925b20ceaea4122c59d2d2c4e7d4ae991fde (diff)
downloadlibft-ad33f31d00cdf5593baa83b63eb5445ef2951250.tar.gz
libft-ad33f31d00cdf5593baa83b63eb5445ef2951250.tar.bz2
libft-ad33f31d00cdf5593baa83b63eb5445ef2951250.zip
Added ft_memdup, Fixing ft_strtoupperft_ssl
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/ft_memdup.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mem/ft_memdup.c b/src/mem/ft_memdup.c
new file mode 100644
index 0000000..0c66cc5
--- /dev/null
+++ b/src/mem/ft_memdup.c
@@ -0,0 +1,22 @@
+/* ************************************************************************** */
+/* */
+/* ::: :::::::: */
+/* ft_memdup.c :+: :+: :+: */
+/* +:+ +:+ +:+ */
+/* By: charles <me@cacharle.xyz> +#+ +:+ +#+ */
+/* +#+#+#+#+#+ +#+ */
+/* Created: 2020/08/02 13:54:17 by charles #+# #+# */
+/* Updated: 2020/08/02 13:55:05 by charles ### ########.fr */
+/* */
+/* ************************************************************************** */
+
+#include "libft_io.h"
+
+void *ft_memdup(const void *src, size_t n)
+{
+ void *ret;
+
+ if ((ret = malloc(n)) == NULL)
+ return (NULL);
+ return (ft_memcpy(ret, src, n));
+}