1.3.3-2: fseek fails on multiples of 1024 (binary mode)
Wed Oct 24 11:11:00 GMT 2001
Christopher Faylor wrote:
> On Tue, Oct 23, 2001 at 11:07:03PM -0400, Christopher Faylor wrote:
> >Is this fixed in more recent BSD code, perhaps? Or has the code diverged too far
> >for this to be useful?
> Answering my own question: No, the code hasn't changed that much and
> there seems to be one minor change in it, which is below.
> Is it my imagination or does this actually fix the problem? I haven't
> studied the code that much but, from context, the patch makes sense.
Thanks Chris. Yes, it makes sense. Your patch has been checked in.
-- Jeff J.
> Index: libc/stdio/fseek.c
> RCS file: /cvs/uberbaum/newlib/libc/stdio/fseek.c,v
> retrieving revision 22.214.171.124
> diff -p -r126.96.36.199 fseek.c
> *** fseek.c 2000/02/17 19:39:47 188.8.131.52
> --- fseek.c 2001/10/24 03:20:13
> *************** fseek (fp, offset, whence)
> *** 278,283 ****
> --- 278,284 ----
> if ((*seekfn) (fp->_cookie, curoff, SEEK_SET) == POS_ERR)
> goto dumb;
> fp->_r = 0;
> + fp->_p = fp->_bf._base;
> if (HASUB (fp))
> FREEUB (fp);
> fp->_flags &= ~__SEOF;
More information about the Newlib