/* By: ljiriste <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/08/15 11:34:52 by ljiriste #+# #+# */
-/* Updated: 2023/09/05 18:26:57 by ljiriste ### ########.fr */
+/* Updated: 2023/09/06 13:06:22 by ljiriste ### ########.fr */
/* */
/* ************************************************************************** */
+/* This should not be commented as to emulate builtin calloc
+ but errno calls function which is deemed forbidden by Moulinette
#include <errno.h>
+ if (total_bytes / size != nmemb)
+ {
+ errno = ENOMEM;
+ return (NULL);
+ }
+*/
#include <stdlib.h> // for malloc
#include "libft.h"
return (malloc(0));
total_bytes = nmemb * size;
if (total_bytes / size != nmemb)
- {
- errno = ENOMEM;
return (NULL);
- }
res = malloc(total_bytes);
if (res == NULL)
return (NULL);