> On 30 Apr 2025, at 15:14, David Rowley wrote:
> On Thu, 1 May 2025 at 00:44, Peter Eisentraut wrote:
>> I think it's best in general to use str* for strings and mem* for
>> not-strings. That's easier to read and also better for static analyzers
>> etc.
>
> The reason I think memcpy is better
On Thu, 1 May 2025 at 00:44, Peter Eisentraut wrote:
>
> On 30.04.25 13:56, David Rowley wrote:
> > In case you're looking for inspiration on a standard to follow,
> > commits such as 586dd5d6a did seem to favour memcpy() when the length
> > was known and only use strlcpy() when it wasn't.
>
> It
On 30.04.25 13:56, David Rowley wrote:
On Wed, 30 Apr 2025 at 23:43, David Rowley wrote:
memcpy() would make more sense IMO, since the length is
known already. I'm fine with either, however.
In case you're looking for inspiration on a standard to follow,
commits such as 586dd5d6a did seem to
On Wed, 30 Apr 2025 at 23:43, David Rowley wrote:
> memcpy() would make more sense IMO, since the length is
> known already. I'm fine with either, however.
In case you're looking for inspiration on a standard to follow,
commits such as 586dd5d6a did seem to favour memcpy() when the length
was kno
On Wed, 30 Apr 2025 at 23:27, Daniel Gustafsson wrote:
> How about using strlcpy as suggested by Peter?
>
> - strncpy(nameptr, "Remaining Totals", namelen);
> - nameptr[namelen] = '\0';
> + strlcpy(nameptr, "Remaining Totals", namel
> On 30 Apr 2025, at 12:57, David Rowley wrote:
>
> On Wed, 30 Apr 2025 at 21:36, Daniel Gustafsson
> 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?
-
On Wed, 30 Apr 2025 at 21:36, Daniel Gustafsson
wrote:
> Add missing string terminator
A possible minor niggle. Would memcpy not be a more suitable function
for this? It's just there've been a few efforts in the past to try
and minimise the usage of strncpy(). There should really just be a
smal