4.3BSD-UWisc/src/lib/libc/gen/calloc.c

Compare this file to the similar file:
Show the results in this format:

#if defined(LIBC_RCS) && !defined(lint)
static char rcs_id[] =
	"$Header: calloc.c,v 1.3 86/09/08 14:42:11 tadl Exp $";
#endif
/*
 * RCS info
 *	$Locker:  $
 */
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)calloc.c	5.2 (Berkeley) 3/9/86";
#endif LIBC_SCCS and not lint

/*
 * Calloc - allocate and clear memory block
 */
char *
calloc(num, size)
	register unsigned num, size;
{
	extern char *malloc();
	register char *p;

	size *= num;
	if (p = malloc(size))
		bzero(p, size);
	return (p);
}

cfree(p, num, size)
	char *p;
	unsigned num;
	unsigned size;
{
	free(p);
}