summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fseek.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-30 20:19:45 +0000
committerache <ache@FreeBSD.org>2001-08-30 20:19:45 +0000
commit5141c6e8a2f9eeaa4aeea9db00faf05824373f78 (patch)
tree1e3710e773c01ab41c7bad899a4da327ef84dea9 /lib/libc/stdio/fseek.c
parentf8e201c54991f8ae822c054363d85332f5b9a013 (diff)
downloadFreeBSD-src-5141c6e8a2f9eeaa4aeea9db00faf05824373f78.zip
FreeBSD-src-5141c6e8a2f9eeaa4aeea9db00faf05824373f78.tar.gz
goto dumb; if can't obtain curoff for whence != SEEK_CUR cases, as supposed
Diffstat (limited to 'lib/libc/stdio/fseek.c')
-rw-r--r--lib/libc/stdio/fseek.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c
index a5a9f30..aa886d2 100644
--- a/lib/libc/stdio/fseek.c
+++ b/lib/libc/stdio/fseek.c
@@ -256,17 +256,13 @@ _fseeko(fp, offset, whence, ltest)
fp->_p -= curoff;
fp->_r += curoff;
curoff = 0;
- } else {
- errno = EBADF;
- return (-1);
- }
+ } else
+ goto dumb;
}
if (HASUB(fp)) {
curoff -= fp->_ur;
- if (curoff < 0) {
- errno = EBADF;
- return (-1);
- }
+ if (curoff < 0)
+ goto dumb;
}
}
OpenPOWER on IntegriCloud