From f00df8355cfea7364defb72e3d4e7d06a7fe52d4 Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 31 Aug 2001 18:54:44 +0000 Subject: Drop buffer first, _then_ ask for real position --- lib/libc/stdio/ftell.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/libc') 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; } } -- cgit v1.1