kolibrios/programs/develop/ktcc/trunk/libc.obj/source/stdio/fgets.c
turbocat 8fa851ddb6 libc.obj:
strtol.с  - removed existing definitions;
fgets.c - uses fread() to read;
gets.c  - added additional check;

git-svn-id: svn://kolibrios.org@9081 a494cfbc-eb01-0410-851d-a64ba20cac60
2021-07-24 21:28:39 +00:00

19 lines
307 B
C

#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;
}
i = fread(str, n-1, sizeof(char), stream);
if(i<1){ return NULL; }
return str;
}