pgsql-server: Add missing null terminator to escaped string; clean up

Started by Tom Laneover 21 years ago3 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Log Message:
-----------
Add missing null terminator to escaped string; clean up unnecessarily
obscurantist coding conventions.

Modified Files:
--------------
pgsql-server/src/bin/initdb:
initdb.c (r1.58 -> r1.59)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/initdb/initdb.c.diff?r1=1.58&r2=1.59)

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgsql-server: Add missing null terminator to escaped

Thanks. Wonder why my testing worked? I guess xmalloc was giving me
zeroed memory.

---------------------------------------------------------------------------

Tom Lane wrote:

Log Message:
-----------
Add missing null terminator to escaped string; clean up unnecessarily
obscurantist coding conventions.

Modified Files:
--------------
pgsql-server/src/bin/initdb:
initdb.c (r1.58 -> r1.59)
(http://developer.postgresql.org/cvsweb.cgi/pgsql-server/src/bin/initdb/initdb.c.diff?r1=1.58&r2=1.59)

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#2)
Re: pgsql-server: Add missing null terminator to escaped

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Thanks. Wonder why my testing worked? I guess xmalloc was giving me
zeroed memory.

One-shot programs like initdb are very likely to see all-zeroed memory,
since that's what the kernel gives you. It's only after you start
freeing things that you'll get nonzero areas from malloc ...

regards, tom lane