scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#include <stdlib.h>
 2#include <string.h>
 3#include <stdint.h>
 4
 5#undef calloc
 6
 7void *
 8calloc(size_t nmemb, size_t size)
 9{
10	size_t nbytes;
11	void *mem;
12
13	if (!nmemb || !size || nmemb > SIZE_MAX/size)
14                return NULL;
15
16	nbytes = nmemb * size;
17	if ((mem = malloc(nbytes)) == NULL)
18		return NULL;
19	return memset(mem, 0, nbytes);
20}