home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
unix
/
volume12
/
cnews
/
part01
/
libc
/
emalloc.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1987-10-19
|
360 b
|
23 lines
/*
* emalloc - malloc with error() called when out of space
*/
#define NULL 0
char *
emalloc(amount)
unsigned amount;
{
register char *it;
char camount[25]; /* Enough to sprintf an unsigned. */
extern char *malloc();
it = malloc(amount);
if (it == NULL) {
sprintf(camount, "%u", amount);
error("malloc(%s) failed", camount);
}
return(it);
}