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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Avoid unnecessary use of strncpy in a couple of places in ecpg.
Дата
Msg-id E1fUGPd-0001JI-5m@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8b444a3539758ce6666679608f3765608f92e0df

Modified Files
--------------
src/interfaces/ecpg/ecpglib/descriptor.c | 2 +-
src/interfaces/ecpg/pgtypeslib/common.c  | 6 ++----
2 files changed, 3 insertions(+), 5 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix some minor error-checking oversights inParseFuncOrColumn().
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Use -Wno-format-truncation and -Wno-stringop-truncation,if avai