File: emalloc.c

package info (click to toggle)
wmii2 2.5.2-11
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 608 kB
  • ctags: 925
  • sloc: ansic: 9,195; makefile: 184; sh: 11
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;
}