Re: [PATCH] Input: wacom_w8001 - replace strlcat() with a strscpy() helper

David Laight <[email protected]>
Newsgroups org.kernel.vger.linux-hardening,org.kernel.vger.linux-input,org.kernel.vger.linux-kernel
Message-ID <20260716103236.28c1b5bb@pumpkin>
On Tue, 14 Jul 2026 20:22:41 -0500
Ian Bridges <[email protected]> wrote:

> In preparation for removing the strlcat() API[1], replace its five
> uses with a small append helper built on strnlen() and strscpy().
> 
> The five calls append device name fragments to a basename buffer
> that grows in place across the setup functions. The helper takes
> the same arguments as strlcat() and writes the same bytes, including
> when a fragment is truncated.

You can do much better than that...

Change w8001_setup_touch/pen() to return the 'const char *' name,
then put everything together in the final snprintf().

	David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.