delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/11/15/19:24:34

Sender: richdawe AT bigfoot DOT com
Message-ID: <3A1328A7.C9866232@bigfoot.com>
Date: Thu, 16 Nov 2000 00:21:59 +0000
From: Richard Dawe <richdawe AT bigfoot DOT com>
X-Mailer: Mozilla 4.51 [en] (X11; I; Linux 2.2.17 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com, Alain Magloire <alain AT qnx DOT com>
Subject: Re: snprintf() diff
References: <200011132023 DOT PAA04930 AT qnx DOT com>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Alain Magloire wrote:
> One thing, but my memory is failing (old age ?) it was about
> _filbuf() or something, this was not clearly related to snprintf()
> but it was trigger by it.  stdio was trying to do fflush()
> on _IOSTR buffer or refill its buffer, which it should not do.
> Maybe Eli has a trace in its email archive about this.

I think this has been sorted out. __putc_raw() calls _flsbuf() to provide
buffer space, if there is not enough. We have added an extra case for
string buffers, to prevent the buffer being refilled. This is the else
clause below:

static __inline__ int __putc_raw(int const x,FILE *const p)
{
   if(p->_cnt>0)
   {
      p->_cnt--;
      return((unsigned char)(*(p->_ptr++)=(unsigned char)x));
   }
   else if (p->_flag & _IOSTRG)
   {
      /* noop for full string buffers */
      return((unsigned char)x);
   }
   return(_flsbuf((unsigned char)x,p));
}

[ This is taken from my second diff. ]

Bye, Rich

-- 
Richard Dawe
[ mailto:richdawe AT bigfoot DOT com | http://www.bigfoot.com/~richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019