Re: [HACKERS] Open 6.4 items - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Open 6.4 items
Date
Msg-id 23787.907968022@sss.pgh.pa.us
Whole thread Raw
In response to Re: [HACKERS] Open 6.4 items  (Tom Ivar Helbekkmo <tih@nhh.no>)
List pgsql-hackers
Tom Ivar Helbekkmo <tih@nhh.no> writes:
> As far as I
> can tell, the only actual error in Paul Vixie's code is that the two
> lines you quote above should be:
>             else if (--size > 0)
>                 *++dst = 0, dirty = 0;

No, that's still wrong, because it will error out (jump to emsgsize)
one byte sooner than it should.  The loop is fundamentally broken
because it wants to grab and zero a byte before it knows whether there
are any digits for the byte.

I think its behavior for an odd number of digits is wrong too, or at
least pretty nonintuitive.  I like my code a lot better ;-)

            regards, tom lane

pgsql-hackers by date:

Previous
From: Brook Milligan
Date:
Subject: Re: [HACKERS] dynamic libraries
Next
From: jwieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] PL compile warning messages