| 1 |
greg |
1.1 |
/* Copyright (c) 1991 Regents of the University of California */
|
| 2 |
|
|
|
| 3 |
|
|
#ifndef lint
|
| 4 |
|
|
static char SCCSid[] = "$SunId$ 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 |
|
|
}
|