pgsql: Cosmetic improvements in new config_info code.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Cosmetic improvements in new config_info code.
Date: 2016-02-21 16:38:29
Message-ID: E1aXX1h-0004Yg-CB@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Cosmetic improvements in new config_info code.

Coverity griped about use of unchecked strcpy() into a local variable.
There's unlikely to be any actual bug there, since no caller would be
passing a path longer than MAXPGPATH, but nonetheless use of strlcpy()
seems preferable.

While at it, get rid of unmaintainable separation between list of
field names and list of field values in favor of initializing them
in parallel. And we might as well declare get_configdata()'s path
argument as const char *, even though no current caller needs that.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c7a1c5a6b6aa4bbc2c9619edc94368fccc1c8c8e

Modified Files
--------------
src/common/config_info.c | 176 +++++++++++++++++++--------------------
src/include/common/config_info.h | 2 +-
2 files changed, 89 insertions(+), 89 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-02-21 17:45:36 Re: Re: [COMMITTERS] pgsql: Introduce group locking to prevent parallel processes from deadl
Previous Message Andrew Dunstan 2016-02-21 15:42:18 pgsql: Fix two-argument jsonb_object when called with empty arrays

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-02-21 17:45:36 Re: Re: [COMMITTERS] pgsql: Introduce group locking to prevent parallel processes from deadl
Previous Message Pavel Stehule 2016-02-21 15:39:46 Re: proposal: enhancing slow query log, and autoexplain log about waiting on lock before query exec time