macro and text revision (-mdoc version 3)
[unix-history] / usr / src / lib / libc / stdlib / calloc.c
CommitLineData
3639a16a
KB
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
08e97220
KB
3 * All rights reserved.
4 *
3639a16a 5 * %sccs.include.redist.c%
c488b005 6 */
08e97220
KB
7
8#if defined(LIBC_SCCS) && !defined(lint)
f0a345ab 9static char sccsid[] = "@(#)calloc.c 5.6 (Berkeley) %G%";
08e97220
KB
10#endif /* LIBC_SCCS and not lint */
11
3639a16a 12#include <stdlib.h>
f0a345ab 13#include <string.h>
08e97220 14
3639a16a
KB
15void *
16calloc(num, size)
17 size_t num;
18 register size_t size;
18a0be3d 19{
3639a16a 20 register void *p;
18a0be3d 21
3639a16a
KB
22 size *= num;
23 if (p = malloc(size))
24 bzero(p, size);
08e97220 25 return(p);
18a0be3d
BJ
26}
27
94b2e090 28void
f0a345ab 29cfree(p)
3639a16a 30 void *p;
18a0be3d 31{
3639a16a 32 (void)free(p);
18a0be3d 33}