Re: [PATCH] fs: fuse: Use strscpy instead of strcpy
From: Miklos Szeredi
Date: Fri Sep 19 2025 - 02:43:34 EST
On Wed, 17 Sept 2025 at 22:55, Miquel Sabaté Solà <mssola@xxxxxxxxxx> wrote:
>
> As pointed out in [1], strcpy() is deprecated in favor of
> strscpy().
>
> Furthermore, the length of the name to be copied is well known at this
> point since we are going to move the pointer by that much on the next
> line. Hence, it's safe to assume 'namelen' for the length of the string
> to be copied.
By "length of a string" usually the number of non-null chars is meant
(i.e. strlen(str)).
So the variable 'namelen' is confusingly named, a better one would be namesize.
>
> [1] KSPP#88
I don't understand this notation.
Patch itself looks good.
Thanks,
Miklos