pgsql: Convert strncpy to strlcpy

From: Daniel Gustafsson <dgustafsson(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Convert strncpy to strlcpy
Date: 2025-04-30 21:11:57
Message-ID: E1uAEij-000Nol-0v@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Convert strncpy to strlcpy

We try to avoid using strncpy() due to the ease of which it can
be misused. Convert this callsite to use strlcpy() instead to
match similar codepaths in this file.

Suggested-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Discussion: https://postgr.es/m/2a796830-de2d-4030-b480-d673f6cc5d94@eisentraut.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/45e7e8ca9e9382e8f5e51fe0c085ea7f5d408ac8

Modified Files
--------------
src/backend/utils/mmgr/mcxt.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Robert Haas 2025-04-30 22:00:45 Re: pgsql: Add function to get memory context stats for processes
Previous Message Daniel Gustafsson 2025-04-30 20:29:33 Re: pgsql: Add function to get memory context stats for processes