bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gawk number to string bug


From: Andrew J. Schorr
Subject: Re: gawk number to string bug
Date: Sat, 24 Dec 2005 13:52:09 -0500
User-agent: Mutt/1.4.1i

On Sat, Dec 24, 2005 at 09:22:16AM +0200, Eli Zaretskii wrote:
> This thread produced many ideas and quite a few patches
> (some of the patches made me shiver with horror in sight of the
> monstrosity of a solution offered for such a simple problem), but IMHO
> it failed to produce 2 things: (1) the Gawk maintainer's agreement to
> all those ideas and patches, and (2) references to some standard, such
> as Posix, as to what should Gawk do in these situations.  To me, these
> deficiencies makes this whole discussion a bit pointless.

I agree that these patches are all a work in progress, intended
to stimulate discussion, and hopefully lead to an agreement on the best
approach to take.

That being said, I did discover a real buffer overflow bug that should
be fixed, I think.  Or do you propose leaving the buggy code as is?

If you try the latest version of my patch for the printf "%d" problem,
I think it should produce pretty consistent results, fix the buffer overflow,
and is not too hairy.  I think it at least points in the right direction,
but perhaps I'm wrong.  I'm certainly open to other ideas.  I checked
the single-unix spec on awk, but could not find a clear statement
on how printf "%d" should behave.  My current sense is that it should
first truncate the value (as in standard float to integer conversion), and then
print it as with "%.0f".  But I could easily be wrong.

Regards,
Andy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]