home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
RADIANCE
/
SRC
/
COMMON
/
SAVQSTR.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-07
|
584b
|
36 lines
/* Copyright (c) 1991 Regents of the University of California */
#ifndef lint
static char SCCSid[] = "@(#)savqstr.c 2.1 11/12/91 LBL";
#endif
/*
* Quick and dirty string saver.
*/
#define NULL 0
extern char *strcpy(), *strcat(), *bmalloc();
char *
savqstr(s) /* save a private string */
char *s;
{
register char *cp;
if ((cp = bmalloc(strlen(s)+1)) == NULL) {
eputs("out of memory in savqstr");
quit(1);
}
(void)strcpy(cp, s);
return(cp);
}
freeqstr(s) /* free a private string */
char *s;
{
bfree(s, strlen(s)+1);
}