File:  [MW Coherent from dump] / coherent / b / lib / libc / gen / malloc / calloc.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * C general utilities library.
 * calloc()
 * ANSI 4.10.3.1.
 * Allocate and clear.
 */

#include <stdlib.h>
#include <string.h>

__VOID__ *
calloc(nmemb, size) size_t nmemb; register size_t size;
{
	register __VOID__ *bp;
	long lsize;

	lsize = (long)size * nmemb;
	size *= nmemb;
	if (lsize != (long)size)
		return (__VOID__ *)NULL;
	if ((bp = malloc(size)) != NULL)
		memset(bp, 0, size);
	return bp;
}

/* end of calloc.c */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.