xref: /plan9/sys/src/ape/lib/ap/stdio/gets.c (revision 3e12c5d1bb89fc02707907988834ef147769ddaf)
1 /*
2  * pANS stdio -- gets
3  */
4 #include "iolib.h"
gets(char * as)5 char *gets(char *as){
6 #ifdef secure
7 	stdin->flags|=ERR;
8 	return NULL;
9 #else
10 	char *s=as;
11 	int c;
12 	while((c=getchar())!='\n' && c!=EOF) *s++=c;
13 	if(c!=EOF || s!=as) *s='\0';
14 	else return NULL;
15 	return as;
16 #endif
17 }
18