outs for programs using alternae memory allocators:
[unix-history] / usr / src / lib / libc / stdio / gets.c
CommitLineData
b8f253e8
KM
1#ifndef lint
2static char sccsid[] = "@(#)gets.c 5.1 (Berkeley) %G%";
3#endif not lint
4
c3d4b9ff
BJ
5#include <stdio.h>
6
7char *
8gets(s)
9char *s;
10{
11 register c;
12 register char *cs;
13
14 cs = s;
41e01b3e 15 while ((c = getchar()) != '\n' && c != EOF)
c3d4b9ff 16 *cs++ = c;
41e01b3e 17 if (c == EOF && cs==s)
c3d4b9ff
BJ
18 return(NULL);
19 *cs++ = '\0';
20 return(s);
21}