2021-04-27 16:33:31 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include "conio.h"
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
char *fgets(char *str, int n, FILE *stream)
|
|
|
|
{
|
|
|
|
int i=0, sym_code;
|
|
|
|
|
|
|
|
if(!stream || !str){
|
|
|
|
errno = EINVAL;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-07-24 21:28:39 +00:00
|
|
|
i = fread(str, n-1, sizeof(char), stream);
|
2021-04-27 16:33:31 +00:00
|
|
|
if(i<1){ return NULL; }
|
|
|
|
return str;
|
|
|
|
}
|
2021-07-24 21:28:39 +00:00
|
|
|
|