dcn@ihuxl.UUCP (11/12/83)
/* fgets - read a line from a file. (returns NULL at eof) */
#include "stdio.h"
char *fgets(line, maxline, input)
char *line ;
int maxline ;
FILE *input ;
{
int c ;
char *start_line ;
start_line = line;
while( --maxline>0 && (c=agetc(input)) != EOF )
if( (*line++ = c) == NL )
break ;
*line = 0 ;
if( c == EOF && line == start_line )
return(NULL) ;
return(line) ;
}