Mail Archives: djgpp-workers/1999/06/15/02:57:11
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.
- Raw text -