home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Unix / CNews / Source / libc / fgetline.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-17  |  317 b   |  19 lines

  1. /*
  2.  * simulate 4.4BSD fgetline using the more general fgetfln primitives
  3.  */
  4.  
  5. #include <stdio.h>
  6. #include <fgetfln.h>
  7.  
  8. char *
  9. fgetline(fp, lenp)
  10. FILE *fp;
  11. register int *lenp;
  12. {
  13.     register char *line = fgetfln(fp, -1, lenp);
  14.  
  15.     if (line != NULL)
  16.         (void) dogets(line, lenp);    /* stomp innocent newline */
  17.     return line;
  18. }
  19.