home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
gondwana.ecr.mu.oz.au/pub/
/
Graphics.tar
/
Graphics
/
atomart.tar.gz
/
atomart.tar
/
smalloc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-06-14
|
327b
|
24 lines
#include <stdio.h>
extern char *malloc();
/*
* smalloc
*
* allocates memory - checking for null
*/
char *
smalloc(size)
unsigned size;
{
char *p, buf[BUFSIZ];
if ((p = malloc(size)) == (char *)NULL) {
sprintf(buf, "smalloc: request for %d bytes from malloc returns NULL.\n", size);
fatal(buf);
}
return(p);
}