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

Defined functions

fgets defined in line 3; used 57 times
Last modified: 1979-01-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 527
Valid CSS Valid XHTML 1.0 Strict