home *** CD-ROM | disk | FTP | other *** search
/ minnie.tuhs.org / unixen.tar / unixen / PDP-11 / Trees / V6 / usr / source / iolib / gets.c < prev    next >
Encoding:
C/C++ Source or Header  |  1975-05-13  |  251 b   |  14 lines

  1. gets (s)
  2. char *s;
  3. { /* gets (s) - read a string with cgetc and store in s */
  4. char *p;
  5. extern int cin;
  6. if (nargs () == 2)
  7.     IEHzap("gets  ");
  8. p=s;
  9. while ((*s = cgetc(cin)) != '\n' && *s != '\0') s++;
  10. if (*p == '\0') return (0);
  11. *s = '\0';
  12. return (p);
  13. }
  14.