File: Vmalloc.c

package info (click to toggle)
acm4 4.7-18
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 4,776 kB
  • ctags: 1,621
  • sloc: ansic: 16,777; makefile: 364; sh: 31
file content (23 lines) | stat: -rw-r--r-- 376 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "Vlib.h"

#if !HAVE_STDLIB_H
#if HAVE_MALLOC_H
#include <malloc.h>
#else
extern char * malloc();
#endif
#endif

char *Vmalloc(size)
int	size; {

	char	*p;

	if ((p = malloc(size)) == (char *) NULL) {
		fprintf (stderr, "V package memory allocation error.\n");
		fprintf (stderr, "An error was encountered allocating\
 %d bytes.\n", size);
		exit (1);
	}
	return p;
}