aboutsummaryrefslogtreecommitdiffstats
path: root/ft_calloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ft_calloc.c')
-rw-r--r--ft_calloc.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/ft_calloc.c b/ft_calloc.c
deleted file mode 100644
index 7726c64..0000000
--- a/ft_calloc.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include "libft.h"
-#include <stdlib.h>
-
-void *
-ft_calloc (size_t nmemb, size_t size)
-{
- void *ptr;
- size_t total;
-
- // Detect multiplication overflow before allocating.
- if (nmemb && size > (size_t)-1 / nmemb)
- return (NULL);
- total = nmemb * size;
- ptr = malloc (total);
- if (!ptr)
- return (NULL);
- ft_bzero (ptr, total);
- return (ptr);
-}