home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff319.lzh
/
CNewsSrc
/
cnews.orig.lzh
/
libcnews
/
strsave.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-06-27
|
468b
|
24 lines
/*
* strsave - like strdup, but error if can't allocate
*/
#include <stdio.h>
#include <sys/types.h>
#include "libc.h"
#include "news.h"
/*
* Copy "s" into malloced memory, if any is available.
* If not, unlock the news system, print a message and exit,
* else return the address of the malloced memory.
*/
char *
strsave(s)
register char *s;
{
register char *news =nemalloc((unsigned)strlen(s)+1); /* include NUL */
(void) strcpy(news, s);
return news;
}