Commit | Line | Data |
---|---|---|
2ce81398 DS |
1 | #if defined(LIBC_SCCS) && !defined(lint) |
2 | static char sccsid[] = "@(#)calloc.c 5.2 (Berkeley) %G%"; | |
3 | #endif LIBC_SCCS and not lint | |
18a0be3d | 4 | |
c488b005 S |
5 | /* |
6 | * Calloc - allocate and clear memory block | |
7 | */ | |
18a0be3d BJ |
8 | char * |
9 | calloc(num, size) | |
c488b005 | 10 | register unsigned num, size; |
18a0be3d | 11 | { |
c488b005 S |
12 | extern char *malloc(); |
13 | register char *p; | |
18a0be3d | 14 | |
c488b005 S |
15 | size *= num; |
16 | if (p = malloc(size)) | |
17 | bzero(p, size); | |
18 | return (p); | |
18a0be3d BJ |
19 | } |
20 | ||
21 | cfree(p, num, size) | |
c488b005 S |
22 | char *p; |
23 | unsigned num; | |
24 | unsigned size; | |
18a0be3d BJ |
25 | { |
26 | free(p); | |
27 | } |