Date: Tue, 15 Jun 1999 09:53:33 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Alain Magloire cc: djgpp-workers AT delorie DOT com Subject: Re: {v,}snprintf.c ??? In-Reply-To: <199906141834.OAA09150@mccoy2.ECE.McGill.CA> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Mon, 14 Jun 1999, Alain Magloire wrote: > I think _IOSTRG is also use for scanf() too, sscanf, not scanf. Only those functions that create fake stream objects use it. > I'll check if _flsbuf() is use intheis case, .. should not . Right now, _flsbuf *will* be called if f->_cnt ever gets to zero. The functions that use _IOSTRG now all set _cnt to INT_MAX, so it will not exhausted for quite some time ;-) But if _cnt is set to something smaller, it will. The resultant call to _flsbuf will either crash or produce random results, since _flsbuf doesn't know about _IOSTRG. What I'm suggesting is to add an "else if" clause to __putc_raw that will check _IOSTRG and return the character without doing anything else. Thus the call to _flsbuf will be avoided.