diff options
Diffstat (limited to 'libio')
-rw-r--r-- | libio/fileops.c | 3 | ||||
-rw-r--r-- | libio/tst-freopen.c | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/libio/fileops.c b/libio/fileops.c index c054d5e7d0..29412968db 100644 --- a/libio/fileops.c +++ b/libio/fileops.c @@ -932,8 +932,7 @@ _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->_IO_buf_end - fp->_IO_buf_base) - - (fp->_IO_read_end - fp->_IO_read_ptr)); + return fp->_offset - (fp->_IO_read_end - fp->_IO_read_ptr); switch (dir) { diff --git a/libio/tst-freopen.c b/libio/tst-freopen.c index 20e5f2f874..8228951071 100644 --- a/libio/tst-freopen.c +++ b/libio/tst-freopen.c @@ -23,10 +23,10 @@ #include <string.h> #include <unistd.h> -int main (void) +int +main (void) { char name[] = "/tmp/tst-freopen.XXXXXX"; - char buf[4096]; const char * const test = "Let's test freopen.\n"; char temp[strlen (test) + 1]; int fd = mkstemp (name); |