summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-10-25 22:56:04 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-10-25 22:56:04 +0000
commit7686e760b5d9c588f94e425ecb5ec92d971b596b (patch)
treec9de2bf6f124eb0fdb57d507ce22093622e77bc3
parent71fc5e11c7a079f0ff988f04a75fbe2a17cd99d3 (diff)
Notes
-rw-r--r--lib/libc/stdio/fseek.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c
index 9dc8bd28275f0..237d7939a0ada 100644
--- a/lib/libc/stdio/fseek.c
+++ b/lib/libc/stdio/fseek.c
@@ -110,7 +110,7 @@ _fseeko(fp, offset, whence, ltest)
int ltest;
{
register fpos_t (*seekfn) __P((void *, fpos_t, int));
- fpos_t target, curoff;
+ fpos_t target, curoff, ret;
size_t n;
struct stat st;
int havepos;
@@ -295,7 +295,8 @@ abspos:
* do it. Allow the seek function to change fp->_bf._base.
*/
dumb:
- if (__sflush(fp) || _sseek(fp, (fpos_t)offset, whence) == POS_ERR)
+ if (__sflush(fp) ||
+ (ret = _sseek(fp, (fpos_t)offset, whence)) == POS_ERR)
return (-1);
/* success: clear EOF indicator and discard ungetc() data */
if (HASUB(fp))
@@ -304,7 +305,7 @@ dumb:
fp->_r = 0;
/* fp->_w = 0; */ /* unnecessary (I think...) */
fp->_flags &= ~__SEOF;
- if (ltest && fp->_offset > LONG_MAX) {
+ if (ltest && ret > LONG_MAX) {
fp->_flags |= __SERR;
errno = EOVERFLOW;
return (-1);