aboutsummaryrefslogtreecommitdiff
path: root/ft_calloc.c
blob: 3d1568d2d6bd61e85b868b10f08889b358568162 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_calloc.c                                        :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: cacharle <marvin@42.fr>                    +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2019/10/07 12:45:37 by cacharle          #+#    #+#             */
/*   Updated: 2019/10/18 13:00:38 by cacharle         ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include <stdlib.h>
#include "libft.h"

void	*ft_calloc(size_t count, size_t size)
{
	void	*mem;

	if ((mem = malloc(count * size)) == NULL)
		return (NULL);
	ft_bzero(mem, count * size);
	return (mem);
}