Messages in this thread | ![/](/images/icornerl.gif) | | From | Justin Stitt <> | Date | Tue, 8 Aug 2023 17:41:01 -0700 | Subject | Re: [PATCH 2/7] netfilter: nf_tables: refactor deprecated strncpy |
| |
On Tue, Aug 8, 2023 at 4:40 PM Florian Westphal <fw@strlen.de> wrote: > > Justin Stitt <justinstitt@google.com> wrote: > > Prefer `strscpy` over `strncpy`. > > Just like all other nft_*.c changes, this relies on zeroing > the remaining buffer, so please use strscpy_pad if this is > really needed for some reason. I'm soon sending a v2 series that prefers `strscpy_pad` to `strscpy` as per Florian and Kees' feedback.
It should be noted that there was a similar refactor that took place in this tree as well [1]. Wolfram Sang opted for `strscpy` as a replacement to `strlcpy`. I assume the zero-padding is not needed in such instances, right?
[1]: https://lore.kernel.org/all/20220818210224.8563-1-wsa+renesas@sang-engineering.com/
Thanks.
| ![\](/images/icornerr.gif) |