maxishell
Implementation of a shell for Linux-like systems
Loading...
Searching...
No Matches
ft_calloc.c File Reference
#include "libft.h"
Include dependency graph for ft_calloc.c:

Go to the source code of this file.

Functions

void * ft_calloc (size_t count, size_t size)
 

Function Documentation

◆ ft_calloc()

void * ft_calloc ( size_t  count,
size_t  size 
)

Definition at line 23 of file ft_calloc.c.

24{
25 void *ptr;
26
27 if (size != 0 && count > SIZE_MAX / size)
28 return (NULL);
29 ptr = malloc(count * size);
30 if (!ptr)
31 return (NULL);
32 ft_memset(ptr, 0, count * size);
33 return (ptr);
34}
void * ft_memset(void *s, int c, size_t n)
Definition ft_memset.c:28

References ft_memset().

Here is the call graph for this function: