summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-08-31 18:54:44 +0000
committerache <ache@FreeBSD.org>2001-08-31 18:54:44 +0000
commitf00df8355cfea7364defb72e3d4e7d06a7fe52d4 (patch)
tree5bc19ece8bc6ab760c3510c344d99fc3a3f77d6c /lib
parent2362fc36bc1d2beae0027a778eeca43c5f18bc8d (diff)
downloadFreeBSD-src-f00df8355cfea7364defb72e3d4e7d06a7fe52d4.zip
FreeBSD-src-f00df8355cfea7364defb72e3d4e7d06a7fe52d4.tar.gz
Drop buffer first, _then_ ask for real position
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdio/ftell.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c
index 974b484..93f1f9e 100644
--- a/lib/libc/stdio/ftell.c
+++ b/lib/libc/stdio/ftell.c
@@ -121,10 +121,10 @@ get_real_pos:
fp->_r += pos;
pos = 0;
} else {
- if (spos == -1)
- goto get_real_pos;
fp->_p = fp->_bf._base;
fp->_r = 0;
+ if (spos == -1)
+ goto get_real_pos;
pos = spos;
}
}
@@ -136,11 +136,11 @@ get_real_pos:
fp->_r += pos;
pos = 0;
} else {
- if (spos == -1)
- goto get_real_pos;
fp->_p = fp->_bf._base;
fp->_r = 0;
FREEUB(fp);
+ if (spos == -1)
+ goto get_real_pos;
pos = spos;
}
}
OpenPOWER on IntegriCloud