xref: /original-bsd/lib/libc/stdlib/calloc.c (revision aba77441)
1 #ifndef lint
2 static char sccsid[] = "@(#)calloc.c	5.1 (Berkeley) 06/05/85";
3 #endif not lint
4 
5 /*
6  * Calloc - allocate and clear memory block
7  */
8 char *
9 calloc(num, size)
10 	register unsigned num, size;
11 {
12 	extern char *malloc();
13 	register char *p;
14 
15 	size *= num;
16 	if (p = malloc(size))
17 		bzero(p, size);
18 	return (p);
19 }
20 
21 cfree(p, num, size)
22 	char *p;
23 	unsigned num;
24 	unsigned size;
25 {
26 	free(p);
27 }
28