aboutsummaryrefslogtreecommitdiffstats
path: root/io/fgetws.c
blob: 69cd1beeb4e4e142467d4ea8128793f76f23f6ae (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "io.h"
#include <errno.h>

char* fgets(char *restrict string, int size, FILE *restrict stream)
{
    int character = 0;
	for(int i=0;character == '\n' || i < size -1;i++){
        character = _fgetc_wrap(stream);
        if(character == _eof_wrap){
            return NULL;
        }
    }

	return string;
}