git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: cec57b1) | patch
Replace remaining StrNCpy() by strlcpy()
2020年8月10日 16:51:31 +0000 (18:51 +0200)
2020年8月10日 21:20:37 +0000 (23:20 +0200)
commit 1784f278a63866cc144fcd0a2127cadba6a2b7f8
Replace remaining StrNCpy() by strlcpy()

They are equivalent, except that StrNCpy() zero-fills the entire
destination buffer instead of providing just one trailing zero. For
all but a tiny number of callers, that's just overhead rather than
being desirable.

Remove StrNCpy() as it is now unused.

In some cases, namestrcpy() is the more appropriate function to use.
While we're here, simplify the API of namestrcpy(): Remove the return
value, don't check for NULL input. Nothing was using that anyway.
Also, remove a few unused name-related functions.

Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/44f5e198-36f6-6cdb-7fa9-60e34784daae%402ndquadrant.com
20 files changed:
contrib/pgcrypto/crypt-des.c diff | blob | blame | history
src/backend/access/transam/slru.c diff | blob | blame | history
src/backend/access/transam/xlogarchive.c diff | blob | blame | history
src/backend/catalog/pg_constraint.c diff | blob | blame | history
src/backend/commands/indexcmds.c diff | blob | blame | history
src/backend/commands/statscmds.c diff | blob | blame | history
src/backend/commands/tablecmds.c diff | blob | blame | history
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/replication/logical/logical.c diff | blob | blame | history
src/backend/replication/slot.c diff | blob | blame | history
src/backend/utils/adt/formatting.c diff | blob | blame | history
src/backend/utils/adt/name.c diff | blob | blame | history
src/backend/utils/adt/pg_locale.c diff | blob | blame | history
src/backend/utils/adt/ruleutils.c diff | blob | blame | history
src/common/exec.c diff | blob | blame | history
src/include/c.h diff | blob | blame | history
src/include/utils/builtins.h diff | blob | blame | history
src/interfaces/ecpg/pgtypeslib/dt_common.c diff | blob | blame | history
src/interfaces/ecpg/test/pg_regress_ecpg.c diff | blob | blame | history
src/test/modules/ssl_passphrase_callback/ssl_passphrase_func.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /