Re: [PATCH] w1: therm: Replace deprecated strcpy with strscpy in alarms_store

From: Krzysztof Kozlowski

Date: Mon Oct 20 2025 - 03:01:11 EST


On 17/10/2025 19:00, Thorsten Blum wrote:
> strcpy() is deprecated because it can overflow when the destination
> buffer is not large enough for the source string. Replace it with

It cannot overflow. Look at the code - memory is allocated for the size.

> strscpy(), which avoids overflows and guarantees NUL-termination.

Maybe NUL-termination is missing, could be.

Anyway please write commit msg describing this exact code, not a generic
one for work replacing strcpy(). Your generic commit msg is just not
applicable here.

And even there, just look at the code - why exactly cannot it be
simplified into ksrtdup?



Best regards,
Krzysztof