mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
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
This commit is contained in:
@ -75,16 +75,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
/*
|
||||
* This Windows file defines StrNCpy. We don't need it here, so we undefine
|
||||
* it to keep the compiler quiet, and undefine it again after the file is
|
||||
* included, so we don't accidentally use theirs.
|
||||
*/
|
||||
#undef StrNCpy
|
||||
#include <shlwapi.h>
|
||||
#ifdef StrNCpy
|
||||
#undef StrNCpy
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define MAX_L10N_DATA 80
|
||||
|
Reference in New Issue
Block a user