Tom Ivar Helbekkmo <tih(at)nhh(dot)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