Re: [PATCH]Remove the redundant assignment
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Heikki Linnakangas <hlinnaka@iki.fi>
Cc: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, Chao Li <li.evan.chao@gmail.com>, Feilong Meng <feelingmeng@foxmail.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-17T00:06:35Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Remove useless code in InjectionPointAttach()
- 1d325ad99cb2 19 (unreleased) landed
On Tue, Dec 16, 2025 at 04:02:53PM +0200, Heikki Linnakangas wrote: >> doc/src/sgml/ecpg.sgml: strncpy(name_buf, v.sqlname.data, v.sqlname.length); >> doc/src/sgml/ecpg.sgml- name_buf[v.sqlname.length] = '\0'; >> -- >> doc/src/sgml/ecpg.sgml: strncpy(name_buf, v.sqlname.data, v.sqlname.length); >> doc/src/sgml/ecpg.sgml- name_buf[v.sqlname.length] = '\0'; >> -- >> src/interfaces/ecpg/ecpglib/execute.c: strncpy(newcopy, (char *) var->value, slen); >> src/interfaces/ecpg/ecpglib/execute.c- newcopy[slen] = '\0'; >> -- >> src/interfaces/ecpg/ecpglib/execute.c: strncpy(mallocedval, (char *) var->value, slen); >> src/interfaces/ecpg/ecpglib/execute.c- mallocedval[slen] = '\0'; >> -- >> src/interfaces/ecpg/ecpglib/execute.c: strncpy(newcopy, variable->arr, variable->len); >> src/interfaces/ecpg/ecpglib/execute.c- newcopy[variable->len] = '\0'; > > I don't know if these depend on the zero-padding... Good question. This code has never been changed since its introduction in a4f25b6a9c2d... But anyway, looking more closely I think that we should be OK with just switching to strlcpy() as long as we do the call with a "len + 1" and not "len" to account for the zero termination based on the allocations done just before copying the values. -- Michael