File: xmalloc.c

package info (click to toggle)
mailleds 0.93-11
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 148 kB
  • ctags: 107
  • sloc: ansic: 864; makefile: 121
file content (27 lines) | stat: -rw-r--r-- 205 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27













#include <stdlib.h>		/* for NULL */

void *xmalloc(bytes)
int bytes;
{
	void *vp;

	vp = malloc(bytes);
	if (vp == NULL && bytes > 0) {
		perror("malloc failed");
		exit(-1);
	}
	return vp;
}