diff options
| author | Peter Eisentraut <peter@eisentraut.org> | 2020-08-10 18:51:31 +0200 |
|---|---|---|
| committer | Peter Eisentraut <peter@eisentraut.org> | 2020-08-10 23:20:37 +0200 |
| commit | 1784f278a63866cc144fcd0a2127cadba6a2b7f8 (patch) | |
| tree | ce0f644de0d3a89fc8b49ff67be8428731cb041b /src/include/utils | |
| parent | cec57b1a0fbcd3833086ba686897c5883e0a2afc (diff) | |
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
Diffstat (limited to 'src/include/utils')
| -rw-r--r-- | src/include/utils/builtins.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h index 3ca5e938f8f..4db5ad3f12e 100644 --- a/src/include/utils/builtins.h +++ b/src/include/utils/builtins.h @@ -39,8 +39,7 @@ extern uint64 hex_decode(const char *src, size_t len, char *dst); extern int2vector *buildint2vector(const int16 *int2s, int n); /* name.c */ -extern int namecpy(Name n1, const NameData *n2); -extern int namestrcpy(Name name, const char *str); +extern void namestrcpy(Name name, const char *str); extern int namestrcmp(Name name, const char *str); /* numutils.c */ |
