pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Tom Ivar Helbekkmo <tih@nhh.no>
Cc: Paul A Vixie <vixie@vix.com>
Cc: hackers@postgreSQL.org
Subject: Re: [HACKERS] Open 6.4 items
Date: Fri, 09 Oct 1998 17:20:22 -0400
Message-ID: <23787.907968022@sss.pgh.pa.us> (raw)
In-Reply-To: <86hfxdcvxu.fsf@athene.nhh.no>

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



view thread (141+ messages)  latest in thread

Message-ID: <23787.907968022@sss.pgh.pa.us>
Permalink:  ../23787.907968022@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23787.907968022@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, tih@nhh.no, vixie@vix.com, hackers@postgreSQL.org
  Subject: Re: [HACKERS] Open 6.4 items
  In-Reply-To: <23787.907968022@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox