> On 30 Apr 2025, at 12:57, David Rowley <dgrowleyml(at)gmail(dot)com> wrote:
>
> On Wed, 30 Apr 2025 at 21:36, Daniel Gustafsson
> <dgustafsson(at)postgresql(dot)org> wrote:
>> Add missing string terminator
>
> A possible minor niggle. Would memcpy not be a more suitable function
> for this?
How about using strlcpy as suggested by Peter?
- strncpy(nameptr, "Remaining Totals", namelen);
- nameptr[namelen] = '\0';
+ strlcpy(nameptr, "Remaining Totals", namelen + 1);
--
Daniel Gustafsson