From 220ee02a0b38726a90430e94714c87550dc3d476 Mon Sep 17 00:00:00 2001 From: Stephen Kitt Date: Thu, 13 Jun 2019 18:25:48 +0200 Subject: docs: stop suggesting strlcpy Since strlcpy is deprecated, the documentation shouldn't suggest using it. This patch fixes the examples to use strscpy instead. It also uses sizeof instead of underlying constants as far as possible, to simplify future changes to the corresponding data structures. Signed-off-by: Stephen Kitt Acked-by: Kees Cook Acked-by: Federico Vaga Signed-off-by: Jonathan Corbet --- Documentation/hid/hid-transport.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Documentation/hid') diff --git a/Documentation/hid/hid-transport.txt b/Documentation/hid/hid-transport.txt index 3dcba9fd4a3a..4f41d67f1b4b 100644 --- a/Documentation/hid/hid-transport.txt +++ b/Documentation/hid/hid-transport.txt @@ -194,9 +194,9 @@ with HID core: goto err_<...>; } - strlcpy(hid->name, , 127); - strlcpy(hid->phys, , 63); - strlcpy(hid->uniq, , 63); + strscpy(hid->name, , sizeof(hid->name)); + strscpy(hid->phys, , sizeof(hid->phys)); + strscpy(hid->uniq, , sizeof(hid->uniq)); hid->ll_driver = &custom_ll_driver; hid->bus = ; -- cgit v1.2.3