Import sources from 2011-03-30 iso image
This commit is contained in:
commit
e5888a1ffd
7810 changed files with 2489717 additions and 0 deletions
17
sys/src/libstdio/gets.c
Executable file
17
sys/src/libstdio/gets.c
Executable file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* pANS stdio -- gets
|
||||
*/
|
||||
#include "iolib.h"
|
||||
char *gets(char *as){
|
||||
#ifdef secure
|
||||
stdin->flags|=ERR;
|
||||
return NULL;
|
||||
#else
|
||||
char *s=as;
|
||||
int c;
|
||||
while((c=getchar())!='\n' && c!=EOF) *s++=c;
|
||||
if(c!=EOF || s!=as) *s='\0';
|
||||
else return NULL;
|
||||
return as;
|
||||
#endif
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue