delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/06/15/02:57:11

Date: Tue, 15 Jun 1999 09:53:33 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Alain Magloire <alainm AT rcsm DOT ece DOT mcgill DOT ca>
cc: djgpp-workers AT delorie DOT com
Subject: Re: {v,}snprintf.c ???
In-Reply-To: <199906141834.OAA09150@mccoy2.ECE.McGill.CA>
Message-ID: <Pine.SUN.3.91.990615094748.2646G-100000@is>
MIME-Version: 1.0
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

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 -


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