Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Jan 1995 21:12:23 +0300
From:      "Andrew A. Chernov, Black Mage" <ache@astral.msk.su>
To:        Doug Rabson <dfr@render.com>
Cc:        freebsd-hackers@freefall.cdrom.com, "Paul F. Werkowski" <pw@snoopy.MV.COM>
Subject:   Re: old vfprintf bug back again in 2.x
Message-ID:  <bB7eL7lmG1@astral.msk.su>
In-Reply-To: <Pine.BSF.3.91.950118175500.527B-100000@minnow.render.com>; from Doug Rabson at Wed, 18 Jan 1995 17:57:53 %2B0000 (GMT)
References:  <Pine.BSF.3.91.950118175500.527B-100000@minnow.render.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <Pine.BSF.3.91.950118175500.527B-100000@minnow.render.com>
    Doug Rabson writes:

>On Wed, 18 Jan 1995, Andrew A. Chernov, Black Mage wrote:

>> In message <Pine.BSF.3.91.950118110149.3845C-100000@minnow.render.com>
>>     Doug Rabson writes:
>> 
>> >I looked into this and I believe that this patch does the same job:
>> 
>> >*** /usr/src/lib/libc/stdio/vfprintf.c	Fri May 27 05:57:31 1994
>> >--- vfprintf.c	Mon Dec 19 16:46:42 1994
>> >***************
>> >*** 507,512 ****
>> >--- 507,514 ----
>> >  			prec = (prec == -1) ?
>> >  				DEFPREC + 1 : prec + 1;
>> >  			/* FALLTHROUGH */
>> >+ 			if (prec != 0)
>> >+ 				flags |= ALT;
>> >  			goto fp_begin;
>> >  		case 'f':		/* always print trailing zeroes */
>> >  			if (prec != 0)
>> 
>> >It certainly helps GCL anyway.  Unless you have any objections, I will 
>> >commit this smaller patch as it seems to be a bit less intrusive.
>> 
>> I think this patch  can be even smaller (only one line affected),
>> just remove "goto fp_begin"
>> after FALLTHROUGH (which really means it without goto fp_begin).

>The "goto fp_begin" skips 2 lines of code for the 'g' format which 
>fiddles with the precision.  I am not sure whether this is a problem or 
>not, so to be on the safe side I left the goto in.

This 2 lines of code is inactive, because prec != -1 there
(it resetted above if -1).


-- 
Andrew A. Chernov        : And I rest so composedly,  /Now, in my bed,
ache@astral.msk.su       : That any beholder  /Might fancy me dead -
FidoNet: 2:5020/230.3    : Might start at beholding me,  /Thinking me dead.
RELCOM Team,FreeBSD Team :         E.A.Poe         From "For Annie" 1849



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bB7eL7lmG1>