File: emalloc.c

package info (click to toggle)
wmii2 2.5.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 592 kB
  • ctags: 927
  • sloc: ansic: 9,195; makefile: 228; sh: 136
file content (22 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * (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"

void           *
emalloc(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;
}