Sender: richdawe AT bigfoot DOT com Message-ID: <3A1328A7.C9866232@bigfoot.com> Date: Thu, 16 Nov 2000 00:21:59 +0000 From: Richard Dawe 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 Subject: Re: snprintf() diff References: <200011132023 DOT PAA04930 AT qnx DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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/ ]