xref: /original-bsd/lib/libc/stdlib/calloc.c (revision 7a8f01dc)
1 /*-
2  * Copyright (c) 1990 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  */
7 
8 #if defined(LIBC_SCCS) && !defined(lint)
9 static char sccsid[] = "@(#)calloc.c	5.5 (Berkeley) 05/17/90";
10 #endif /* LIBC_SCCS and not lint */
11 
12 #include <stdlib.h>
13 
14 void *
15 calloc(num, size)
16 	size_t num;
17 	register size_t size;
18 {
19 	register void *p;
20 
21 	size *= num;
22 	if (p = malloc(size))
23 		bzero(p, size);
24 	return(p);
25 }
26 
27 void
28 cfree(p, num, size)
29 	void *p;
30 	size_t num, size;
31 {
32 	(void)free(p);
33 }
34