w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
PATCH 1/1 w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
strcpy() is deprecated and using strcat() is discouraged. Replace them with scnprintf(). No functional changes.
Signed-off-by Thorsten Blum <[email protected]>
--- drivers/w1/slaves/w1_ds28e17.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/w1/slaves/w1_ds28e17.c +2 -2
@@ -719,8 +719,8 @@ static int w1_f19_add_slave(struct w1_slave *sl) data->adapter.owner =THIS_MODULE ; data->adapter.algo = &w1_f19_i2c_algorithm; data->adapter.algo_data = sl; -strcpy (data->adapter.name,"w1-" ); -strcat (data->adapter.name, sl->name); +scnprintf (data->adapter.name,sizeof (data->adapter.name),"w1-%s" , + sl->name); data->adapter.dev.parent = &sl->dev; data->adapter.quirks = &w1_f19_i2c_adapter_quirks;
Signature · 1 line
2.51.0
Krzysztof Kozlowski
AppliedQuoted 4 lines · Thorsten Blum
strcpy()is deprecated and usingstrcat()is discouraged. Replace them withscnprintf(). No functional changes.
Applied, thanks!
[1/1] w1: ds28e17: Replace deprecated strcpy + strcat in w1_f19_add_slave
https://git.kernel.org/krzk/linux-w1/c/f3c6353d801a9826e234ad477af08b09a98d888b
Best regards,
Signature · 1 line
Krzysztof Kozlowski <[email protected]>