From 7cf30ace8422d718f3823fcdecf7fc5a2fd67772 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Fri, 31 Aug 2001 18:54:44 +0000 Subject: [PATCH] Drop buffer first, _then_ ask for real position --- lib/libc/stdio/ftell.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/libc/stdio/ftell.c b/lib/libc/stdio/ftell.c index 974b484e610..93f1f9ea27b 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; } }