Re: [PATCH] fork: Remove unnecessary size argument when calling strscpy()

From: Thorsten Blum
Date: Tue Mar 18 2025 - 18:50:36 EST


On 11. Mar 2025, at 12:13, Lorenzo Stoakes wrote:
> On Tue, Mar 11, 2025 at 12:05:39PM +0100, Thorsten Blum wrote:
>> The size parameter is optional and strscpy() automatically determines
>> the length of the destination buffer using sizeof() if the argument is
>> omitted. This makes the explicit sizeof() unnecessary. Remove it to
>> simplify the code.
>>
>> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
>
> Hm not sure about this one, it's not really simplifying anything all too
> much and seems like somewhat useless churn?
>
> It's pretty clear what's going on here already.

Yes, but explicitly specifying the default value for an optional
parameter is redundant, and omitting it simplifies the code.

Thanks,
Thorsten