linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Miquel Sabaté Solà" <mssola@mssola.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: linux-fsdevel@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs: fuse: Use strscpy instead of strcpy
Date: Fri, 19 Sep 2025 09:54:03 +0200	[thread overview]
Message-ID: <87qzw2ubc4.fsf@> (raw)
In-Reply-To: <CAJfpegvt8ydN0uKYpbWVAmzZtHJ2kg3PwffZYvB33G_4fnq7BQ@mail.gmail.com> (Miklos Szeredi's message of "Fri, 19 Sep 2025 08:43:22 +0200")

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

Hello,

Miklos Szeredi @ 2025-09-19 08:43 +02:

> On Wed, 17 Sept 2025 at 22:55, Miquel Sabaté Solà <mssola@mssola.com> 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.

That's a good point. If you want I can add a commit renaming this
variable for v2.

>
>>
>> [1] KSPP#88
>
> I don't understand this notation.

This is because it refers to an issue on Github that is tracking the
effort to move away from strcpy in favor of strscpy. I've seen many
commits tracked there that followed this notation and thus I thought
that was the right thing. Anyways, if you want I can transform this
into a Link tag:

Link: https://github.com/KSPP/linux/issues/88

Or otherwise reference it in any other way you feel is more appropiate.

>
> Patch itself looks good.
>
> Thanks,
> Miklos

Thanks,
Miquel

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 897 bytes --]

      reply	other threads:[~2025-09-19  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 20:55 [PATCH] fs: fuse: Use strscpy instead of strcpy Miquel Sabaté Solà
2025-09-19  6:43 ` Miklos Szeredi
2025-09-19  7:54   ` Miquel Sabaté Solà [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87qzw2ubc4.fsf@ \
    --to=mssola@mssola.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).