]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid unnecessary use of strncpy in a couple of places in ecpg.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 16 Jun 2018 18:58:11 +0000 (14:58 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 16 Jun 2018 18:58:48 +0000 (14:58 -0400)
commit537d7f3e18757ac6ddab2e7cec80cc27bf303795
treeaf0776677212e7ce47330266ff38f7707d23438c
parent3243cbc085b8cd54cf12c323da3b5c8298ed5d69
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
src/interfaces/ecpg/ecpglib/descriptor.c
src/interfaces/ecpg/pgtypeslib/common.c