Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <stdio.h>
  3.  
  4. char *
  5. gets(char *s)
  6. {
  7.   int c;
  8.   char *cs;
  9.  
  10.   cs = s;
  11.   while ((c = getchar()) != '\n' && c != EOF)
  12.     *cs++ = c;
  13.   if (c == EOF && cs==s)
  14.     return NULL;
  15.   *cs++ = '\0';
  16.   return s;
  17. }
  18.