ALSA: caiaq: Use strscpy() in snd_usb_caiaq_input_init()
Subsystems (2)
PATCH 1/1 ALSA: caiaq: Use strscpy() in snd_usb_caiaq_input_init()
To prepare for removing strlcat() from the kernel [1], use strscpy() instead with the length returned by usb_make_path() as the append offset.
No functional change.
Signed-off-by Thorsten Blum <[email protected]>
--- sound/usb/caiaq/input.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/usb/caiaq/input.c +4 -2
@@ -605,13 +605,15 @@ int snd_usb_caiaq_input_init(struct snd_usb_caiaqdev *cdev)struct usb_device *usb_dev = cdev->chip.dev;struct input_dev *input;int i, ret =0 ; +int len; input =input_allocate_device ();if (!input)return -ENOMEM ; -usb_make_path (usb_dev, cdev->phys,sizeof (cdev->phys)); -strlcat (cdev->phys,"/input0" ,sizeof (cdev->phys)); + len =usb_make_path (usb_dev, cdev->phys,sizeof (cdev->phys)); +if (len >=0 ) +strscpy (cdev->phys + len,"/input0" ,sizeof (cdev->phys) - len); input->name = cdev->product_name; input->phys = cdev->phys;
Quoted 9 lines · Thorsten Blum
To prepare for removing
strlcat()from the kernel [1], usestrscpy()instead with the length returned byusb_make_path()as the append offset.No functional change.
Signed-off-by Thorsten Blum <[email protected]>
Applied now. Thanks.
Takashi