2 * (c) Copyright 1990 Conor P. Cahill (uunet!virtech!cpcahil).
3 * You may copy, distribute, and use this software as long as this
4 * copyright statement is not removed.
11 * Purpose: to allocate and nullify a data area
13 * Arguments: nelem - number of elements
14 * elsize - size of each element
16 * Returns: NULL - if malloc fails
17 * or pointer to allocated space
19 * Narrative: determine size of area to malloc
22 * fill area with nulls
23 * return ptr to malloc'd region
26 static char rcs_header
[] = "$Id: calloc.c,v 1.2 2006-07-25 10:07:11 rt Exp $";
39 size
= elsize
* nelem
;
41 if( (ptr
= malloc(size
)) != NULL
)
43 (void) memset(ptr
,'\0',(int)size
);