aboutsummaryrefslogtreecommitdiff
path: root/libio/fileops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/fileops.c')
-rw-r--r--libio/fileops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libio/fileops.c b/libio/fileops.c
index 1794dce..5603e5a 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -932,7 +932,8 @@ _IO_file_seekoff_mmap (fp, offset, dir, mode)
using a pushback buffer, but in the usual case has the same value as
(fp->_IO_read_ptr - fp->_IO_buf_base). */
if (mode == 0)
- return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr);
+ return ((fp->_IO_buf_end - fp->_IO_buf_base)
+ - (fp->_IO_read_end - fp->_IO_read_ptr));
switch (dir)
{