home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / RADIANCE / SRC / COMMON / SAVQSTR.C < prev    next >
C/C++ Source or Header  |  1993-10-07  |  584b  |  36 lines

  1. /* Copyright (c) 1991 Regents of the University of California */
  2.  
  3. #ifndef lint
  4. static char SCCSid[] = "@(#)savqstr.c 2.1 11/12/91 LBL";
  5. #endif
  6.  
  7. /*
  8.  *  Quick and dirty string saver.
  9.  */
  10.  
  11. #define  NULL        0
  12.  
  13. extern char  *strcpy(), *strcat(), *bmalloc();
  14.  
  15.  
  16. char *
  17. savqstr(s)            /* save a private string */
  18. char  *s;
  19. {
  20.     register char  *cp;
  21.  
  22.     if ((cp = bmalloc(strlen(s)+1)) == NULL) {
  23.         eputs("out of memory in savqstr");
  24.         quit(1);
  25.     }
  26.     (void)strcpy(cp, s);
  27.     return(cp);
  28. }
  29.  
  30.  
  31. freeqstr(s)            /* free a private string */
  32. char  *s;
  33. {
  34.     bfree(s, strlen(s)+1);
  35. }
  36.