wmii/libcext/emalloc.c

22 lines
349 B
C
Raw Normal View History

2005-11-18 18:54:58 +03:00
/*
* (C)opyright MMIV-MMV Anselm R. Garbe <garbeam at gmail dot com>
* See LICENSE file for license details.
*/
#include <stdlib.h>
#include <stdio.h>
#include "cext.h"
2005-12-05 01:45:59 +03:00
void *emalloc(size_t size)
2005-11-18 18:54:58 +03:00
{
2005-12-05 01:45:59 +03:00
void *res = malloc(size);
2005-11-18 18:54:58 +03:00
if (!res) {
fprintf(stderr, "fatal: could not malloc() %d bytes\n",
2005-12-05 01:45:59 +03:00
(int) size);
2005-11-18 18:54:58 +03:00
exit(1);
}
return res;
}