home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_09 / 8n09038a < prev    next >
Text File  |  1990-07-21  |  478b  |  25 lines

  1. char  *aprintf_base;
  2. char   aprintf_ofst;
  3.  
  4. const char  *aprintf(const char *Format, ...)
  5. {
  6.   va_list  Args;
  7.   va_start(Args,Format);
  8.   aprintf_ofst=0;
  9.   aprintf_base=NULL;
  10.   vdprintf(aprintf_out,Format,Args);
  11.   aprintf_out('\0');
  12.   va_end(Args);
  13.   return  aprintf_base;
  14. }
  15.  
  16. int  aprintf_out(int Char)
  17. {
  18.   aprintf_base=realloc(aprintf_base,aprintf_ofst+1);
  19.   if (aprintf_base==NULL)
  20.     return  EOF;
  21.  
  22.   aprintf_base[aprintf_ofst++]=Char;
  23.   return  Char;
  24. }
  25.