diff --git a/src/system/libroot/posix/glibc/libio/fileops.c b/src/system/libroot/posix/glibc/libio/fileops.c index 2297883f47..ad75784c37 100644 --- a/src/system/libroot/posix/glibc/libio/fileops.c +++ b/src/system/libroot/posix/glibc/libio/fileops.c @@ -1028,14 +1028,14 @@ _IO_new_file_seekoff (fp, offset, dir, mode) { /* Offset relative to start of main get area. */ _IO_off64_t rel_offset = (offset - fp->_offset - + (fp->_IO_read_end - fp->_IO_read_base)); + + (fp->_IO_read_end - fp->_IO_buf_base)); if (rel_offset >= 0) { #if 0 if (_IO_in_backup (fp)) _IO_switch_to_main_get_area (fp); #endif - if (rel_offset <= fp->_IO_read_end - fp->_IO_read_base) + if (rel_offset <= fp->_IO_read_end - fp->_IO_buf_base) { _IO_setg (fp, fp->_IO_buf_base, fp->_IO_buf_base + rel_offset, fp->_IO_read_end); diff --git a/src/system/libroot/posix/glibc/libio/wfileops.c b/src/system/libroot/posix/glibc/libio/wfileops.c index c5ed49a528..6c30b39b87 100644 --- a/src/system/libroot/posix/glibc/libio/wfileops.c +++ b/src/system/libroot/posix/glibc/libio/wfileops.c @@ -638,14 +638,14 @@ _IO_wfile_seekoff (fp, offset, dir, mode) { /* Offset relative to start of main get area. */ _IO_off64_t rel_offset = (offset - fp->_offset - + (fp->_IO_read_end - fp->_IO_read_base)); + + (fp->_IO_read_end - fp->_IO_buf_base)); if (rel_offset >= 0) { #if 0 if (_IO_in_backup (fp)) _IO_switch_to_main_get_area (fp); #endif - if (rel_offset <= fp->_IO_read_end - fp->_IO_read_base) + if (rel_offset <= fp->_IO_read_end - fp->_IO_buf_base) { enum __codecvt_result status; struct _IO_codecvt *cd = fp->_codecvt;