mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 09:24:11 +00:00
Fixed ftell for streams which are opened for reading and writing.
svn path=/trunk/; revision=3038
This commit is contained in:
parent
f0cb69cade
commit
9ac5422074
|
@ -22,15 +22,15 @@ long ftell(FILE *f)
|
||||||
|
|
||||||
if (f->_cnt < 0)
|
if (f->_cnt < 0)
|
||||||
f->_cnt = 0;
|
f->_cnt = 0;
|
||||||
else if (f->_flag&_IOREAD)
|
|
||||||
{
|
|
||||||
adjust = - f->_cnt;
|
|
||||||
}
|
|
||||||
else if (f->_flag&(_IOWRT))
|
else if (f->_flag&(_IOWRT))
|
||||||
{
|
{
|
||||||
if (f->_base && (f->_flag&_IONBF)==0)
|
if (f->_base && (f->_flag&_IONBF)==0)
|
||||||
adjust = f->_ptr - f->_base;
|
adjust = f->_ptr - f->_base;
|
||||||
}
|
}
|
||||||
|
else if (f->_flag&_IOREAD)
|
||||||
|
{
|
||||||
|
adjust = - f->_cnt;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue