> On 30 Apr 2025, at 12:57, David Rowley <dgrowle...@gmail.com> wrote:
> 
> On Wed, 30 Apr 2025 at 21:36, Daniel Gustafsson
> <dgustafs...@postgresql.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



Reply via email to