Re: [PATCH v4] newlib: libc: Fix crash on fprintf to a wide-oriented stream.

Takashi Yano <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
On Wed, 8 Nov 2023 20:40:57 +0100
Corinna Vinschen wrote:
> On Nov  8 21:04, Takashi Yano wrote:
> > --- a/newlib/libc/stdio/local.h
> > +++ b/newlib/libc/stdio/local.h
> > +#define ORIENT(fp,ori)			\
> > +  (					\
> > +    (					\
> > +      ((fp)->_flags & __SORD) ?		\
> > +	0				\
> > +      :					\
> > +	(				\
> 
> You're missing to set (fp)->_flags |= __SORD here.
> 
> > +	  (ori > 0) ?			\
> > +	    ((fp)->_flags2 |= __SWID)	\
> > +	  :				\
> > +	    ((fp)->_flags2 &= ~__SWID)	\
> > +	)				\
> > +    ),					\
> > +    (((fp)->_flags2 & __SWID) ? 1 : -1)	\
> > +  )

Argh! Thanks.

-- 
Takashi Yano <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.