Re: [PATCH v2] btrfs: replace deprecated strcpy with strscpy

From: Mark Harmstone
Date: Thu Jun 19 2025 - 14:20:47 EST


On 19/06/2025 6.59 pm, Brahmajit Das wrote:
On 19.06.2025 18:06, Mark Harmstone wrote:
On 19/06/2025 4.39 pm, Brahmajit Das wrote:
...

Surely this doesn't compile... strscpy takes three parameters.

It does, the third parameter is optional. From include/linux/string.h

#define strscpy(dst, src, ...) \
CONCATENATE(__strscpy, COUNT_ARGS(__VA_ARGS__))(dst, src, __VA_ARGS__)

But I'm more than happy to add the third parameter.

Okay. It looks like this was added by e6584c3964f2ff76a9fb5a701e4a59997b35e547 in
2023 - the docs don't seem to have caught up yet.