Avoid unnecessary use of strncpy in a couple of places in ecpg.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 58065f9eed68fae83ddf98c8dff24ae8f0b62f0c
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2018-06-16T18:58:31Z
Releases: 9.6.10
Avoid unnecessary use of strncpy in a couple of places in ecpg.

Use of strncpy with a length limit based on the source, rather than
the destination, is non-idiomatic and draws warnings from gcc 8.
Replace with memcpy, which does exactly the same thing in these cases,
but with less chance for confusion.

Backpatch to all supported branches.

Discussion: https://postgr.es/m/21789.1529170195@sss.pgh.pa.us

Files

Discussion