home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.src.lzh
/
libc
/
emalloc.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-07-05
|
403b
|
26 lines
/*
* emalloc - malloc with Error() called when out of space
*/
#include <stdio.h>
#include <sys/types.h>
#include "libc.h"
extern void Error();
char *
emalloc(amount)
unsigned amount;
{
register char *it;
char camount[25]; /* Enough to sprintf an unsigned. */
it = malloc(amount);
if (it == NULL) {
sprintf(camount, "%u", amount);
Error("malloc(%s) failed", camount);
}
return(it);
}