Strange error in binary files and RLE

Pages: 12
Sep 14, 2010 at 9:59am
with Qt library I've found the feof() implementation. it consist of a macro which test the eof flag in the file stream:

 
#define feof(__F)     ((__F)->_flag & _IOEOF) 


where the filebuffer struct is:

1
2
3
4
5
6
7
8
9
10
11
typedef struct _iobuf
{
	char*	_ptr;
	int	_cnt;
	char*	_base;
	int	_flag;  // <- this is the inspected flag
	int	_file;
	int	_charbuf;
	int	_bufsiz;
	char*	_tmpfname;
} FILE;


so feof() waits that the reading functions set the file buf EOF- flag to true...that's why it reads a non existing row of the file..
Topic archived. No new replies allowed.
Pages: 12