home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Source / GNU / uucp / Uucp.framework / uucp.subproj / xreall.c < prev   
Encoding:
C/C++ Source or Header  |  1995-10-09  |  432 b   |  24 lines

  1. /* xreall.c
  2.    Realloc a block of memory without fail.  Supposedly some versions of
  3.    realloc can't handle a NULL first argument, so we check for that
  4.    here.  */
  5.  
  6. #include "uucp.h"
  7.  
  8. #include "uudefs.h"
  9.  
  10. pointer
  11. xrealloc (p, c)
  12.      pointer p;
  13.      size_t c;
  14. {
  15.   pointer pret;
  16.  
  17.   if (p == NULL)
  18.     return xmalloc (c);
  19.   pret = realloc (p, c);
  20.   if (pret == NULL && c != 0)
  21.     ulog (LOG_FATAL, "Out of memory");
  22.   return pret;
  23. }
  24.