home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Unix System Administration Handbook 1997 October
/
usah_oct97.iso
/
news
/
cnews.tar
/
libfake
/
fgetline.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-01-02
|
387b
|
23 lines
/*
* simulate 4.4BSD fgetline using the more general fgetfln primitives
*/
#include <stdio.h>
#include <sys/types.h>
#include <fgetfln.h>
char *
fgetline(fp, lenp)
FILE *fp;
register size_t *lenp;
{
int len;
register char *line = fgetfln(fp, -1, &len);
if (line != NULL)
(void) dogets(line, &len); /* stomp innocent newline */
if (lenp != NULL)
*lenp = len;
return line;
}