17 lines · 263 B · C
RawDownload
/* * pANS stdio -- fgets */#include "iolib.h"char *fgets(char *as, int n, FILE *f){	int c=0;	char *s=as;	while(n>1 && (c=getc(f))!=EOF){		*s++=c;		--n;		if(c=='\n') break;	}	if(c==EOF && s==as	|| ferror(f)) return NULL;	if(n) *s='\0';	return as;}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t