home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume3 / pcmail / part08 / myalloc.c < prev   
Encoding:
C/C++ Source or Header  |  1989-02-03  |  392 b   |  26 lines

  1. #include "defs.h"
  2.  
  3. /* fatal - another way to terminate */
  4.  
  5. /* VARARGS1 */
  6.  
  7. public fatal(fmt,a1,a2,a3,a4)
  8. char *fmt;
  9. long a1,a2,a3,a4;
  10. {
  11.     fprintf(stderr,fmt,a1,a2,a3,a4);
  12.     abort();
  13. }
  14.  
  15. /* myalloc - allocate memory or terminate */
  16.  
  17. public char *myalloc(size)
  18. int size;
  19. {
  20.     register char *p;
  21.  
  22.     if ((p = malloc((unsigned)size)) == 0)
  23.     fatal("memory allocation error");
  24.     return(p);
  25. }
  26.