File: emallocz.c

package info (click to toggle)
wmii 3.1-5
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 460 kB
  • ctags: 686
  • sloc: ansic: 7,826; sh: 350; makefile: 182
file content (22 lines) | stat: -rw-r--r-- 365 bytes parent folder | download
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-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(unsigned int size)
{
	void *res = calloc(1, size);

	if(!res) {
		fprintf(stderr, "fatal: could not malloc() %d bytes\n",
				(int) size);
		exit(1);
	}
	return res;
}