home *** CD-ROM | disk | FTP | other *** search
- /* this version of fgetline does not return the trailing newline */
- /* $Date: 91/06/30 17:46:48 $ */
- #include <stdio.h>
-
- static char Rcsid[] = "$What: <@(#) fngetlin.c,v 2.1> $";
-
- fngetline(fp, s, lim)
- FILE *fp;
- char *s;
- int lim;
- {
- int c,i;
-
- i = 0;
- while (--lim > 0 && (c = getc(fp)) != EOF && c != '\n')
- s[i++] = (char) c;
- #if 0
- if (c == '\n')
- s[i++] = (char) c;
- #endif
- s[i] = '\0';
- return i;
- }
-
-