fxlibc/src/libc/stdio/feof.c

14 lines
243 B
C

#include <stdio.h>
int feof(FILE *fp)
{
if(!fp->buf)
return fp->eof;
/* If there is read data to be accessed, the flag doesn't count */
if(fp->bufdir == __FILE_BUF_READ && fp->bufpos < fp->bufread)
return 0;
else
return fp->eof;
}