File:  [MW Coherent from dump] / coherent / b / lib / libc / gen / old / 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>

/*
 * This does not check that size*nmemb fits in a size_t.
 * The return type should be void *.
 */
char *
calloc(nmemb, size) size_t nmemb; register size_t size;
{
	register char *bp;		/* should be void * */

	size *= nmemb;
	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.