xref: /csrg-svn/lib/libc/stdlib/calloc.c (revision 61180)
142117Sbostic /*-
2*61180Sbostic  * Copyright (c) 1990, 1993
3*61180Sbostic  *	The Regents of the University of California.  All rights reserved.
435702Sbostic  *
542117Sbostic  * %sccs.include.redist.c%
635702Sbostic  */
735702Sbostic 
826543Sdonn #if defined(LIBC_SCCS) && !defined(lint)
9*61180Sbostic static char sccsid[] = "@(#)calloc.c	8.1 (Berkeley) 06/04/93";
1035702Sbostic #endif /* LIBC_SCCS and not lint */
111956Swnj 
1242117Sbostic #include <stdlib.h>
1346599Sdonn #include <string.h>
1435702Sbostic 
1542117Sbostic void *
calloc(num,size)1642117Sbostic calloc(num, size)
1742117Sbostic 	size_t num;
1842117Sbostic 	register size_t size;
191956Swnj {
2042117Sbostic 	register void *p;
211956Swnj 
2242117Sbostic 	size *= num;
2342117Sbostic 	if (p = malloc(size))
2442117Sbostic 		bzero(p, size);
2535702Sbostic 	return(p);
261956Swnj }
27