wmii/libcext/emallocz.c
2006-01-20 16:20:24 +02:00

23 lines
395 B
C

/*
* (C)opyright MMIV-MMVI Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
#include <stdlib.h>
#include <stdio.h>
#include "cext.h"
void *
cext_emallocz(size_t size)
{
void *res = calloc(1, size);
if(!res) {
fprintf(stderr, "fatal: could not malloc() %d bytes\n",
(int) size);
exit(1);
}
return res;
}