ref: d68e26e79e47319e2066434c8d4e18c7a653159a
dir: /lib/c/gets.c/
#include <stdio.h>
#undef gets
char *
gets(char *s)
{
int ch;
char *t = s;
while ((ch = getc(stdin)) != EOF && ch != '\n')
*t++ = ch;
if (ch == EOF && s == t)
return NULL;
*t = '\0';
return s;
}