aboutsummaryrefslogtreecommitdiff
path: root/libio/iofopncook.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-31 05:20:53 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-31 05:20:53 +0000
commitde153e7f50baa4ea7fac013f3b77b3a4fe314664 (patch)
tree50fb80d978c873cb63952226707a8683ba31e929 /libio/iofopncook.c
parent02fb3d179ddd3c88f4d4f31d4b27948b48bced2b (diff)
downloadglibc-de153e7f50baa4ea7fac013f3b77b3a4fe314664.tar
glibc-de153e7f50baa4ea7fac013f3b77b3a4fe314664.tar.gz
glibc-de153e7f50baa4ea7fac013f3b77b3a4fe314664.tar.bz2
glibc-de153e7f50baa4ea7fac013f3b77b3a4fe314664.zip
Update.
* stdio-common/Makefile (tests): Add tst-fmemopen. * stdio-common/tst-fmemopen.c: New file. Test case by Ben Collins <bcollins@debian.org>. * libio/iofopncook.c (_IO_cookie_seek): Correct test for error. * libio/fmemopen.c (fmemopen_read): Return 0 at end of buffer. (fmemopen_write): Set errno at end of buffer.
Diffstat (limited to 'libio/iofopncook.c')
-rw-r--r--libio/iofopncook.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libio/iofopncook.c b/libio/iofopncook.c
index c016cfb1d5..52e025b4c9 100644
--- a/libio/iofopncook.c
+++ b/libio/iofopncook.c
@@ -76,7 +76,8 @@ _IO_cookie_seek (fp, offset, dir)
return ((cfile->__io_functions.seek == NULL
|| (cfile->__io_functions.seek (cfile->__cookie, &offset, dir)
- == (_IO_off64_t) -1))
+ == -1)
+ || offset == (_IO_off64_t) -1)
? _IO_pos_BAD : offset);
}