1: /*	@(#)fgets.c	2.1	SCCS id keyword	*/
   2: #include    <stdio.h>
   3: 
   4: char *
   5: fgets(s, n, iop)
   6: char *s;
   7: register FILE *iop;
   8: {
   9:     register c;
  10:     register char *cs;
  11: 
  12:     cs = s;
  13:     while (--n>0 && (c = getc(iop))>=0) {
  14:         *cs++ = c;
  15:         if (c=='\n')
  16:             break;
  17:     }
  18:     if (c<0 && cs==s)
  19:         return(NULL);
  20:     *cs++ = '\0';
  21:     return(s);
  22: }

Defined functions

fgets defined in line 4; used 189 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 825
Valid CSS Valid XHTML 1.0 Strict