12 lines
223 B
C
12 lines
223 B
C
|
#include <stdio.h>
|
||
|
#include "fileutil.h"
|
||
|
|
||
|
char *fgets(char * restrict s, int n, FILE * restrict fp)
|
||
|
{
|
||
|
ssize_t read_size = __fp_fread2(fp, s, n - 1, '\n');
|
||
|
if(read_size <= 0)
|
||
|
return NULL;
|
||
|
s[read_size] = 0;
|
||
|
return s;
|
||
|
}
|