Replace strncpy with strlcpy in selected places that seem possibly relevant
Tom Lane <tgl@sss.pgh.pa.us>
Replace strncpy with strlcpy in selected places that seem possibly relevant to performance. (A wholesale effort to get rid of strncpy should be undertaken sometime, but not during beta.) This commit also fixes dynahash.c to correctly truncate overlength string keys for hashtables, so that its callers don't have to anymore.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/prepare.c | modified | +4 −18 |
| src/backend/nodes/read.c | modified | +2 −2 |
| src/backend/storage/ipc/shmem.c | modified | +6 −9 |
| src/backend/utils/error/elog.c | modified | +11 −7 |
| src/backend/utils/fmgr/dfmgr.c | modified | +2 −6 |
| src/backend/utils/hash/dynahash.c | modified | +21 −7 |
| src/backend/utils/hash/hashfn.c | modified | +10 −2 |
| src/backend/utils/misc/ps_status.c | modified | +2 −2 |
| src/backend/utils/mmgr/portalmem.c | modified | +7 −13 |
| src/port/path.c | modified | +5 −5 |
| src/port/thread.c | modified | +2 −2 |