home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 328_02 / wrealloc.c < prev    next >
C/C++ Source or Header  |  1991-03-17  |  519b  |  26 lines

  1. /*  WREALLOC.C  - shell for realloc() function.
  2.  *
  3.  */
  4. #include "wsys.h"
  5.  
  6. static char OUTOF[] = "OUT OF MEMORY IN ";
  7.  
  8. void *wrealloc ( void *ptr, size_t size,  char *errmsg )
  9.     {
  10.     char both_messages[80];
  11.  
  12.     ptr = realloc ( ptr, size );
  13.  
  14.     _NORMALIZE (ptr);    /* model-dependent */
  15.  
  16.     if ( !ptr  && errmsg )
  17.         {
  18.         strcpy (both_messages, OUTOF);
  19.         strcat (both_messages, errmsg);
  20.         werror ( 'W', both_messages );
  21.         }
  22.  
  23.     return (ptr);
  24.  
  25.     }
  26. /*------------------- end WREALLOC.C --------------------------*/