media: uvc: strncpy -> strscpy
authorHans Verkuil <hverkuil-cisco@xs4all.nl>
Mon, 1 Feb 2021 08:40:56 +0000 (09:40 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Fri, 5 Feb 2021 22:53:20 +0000 (23:53 +0100)
The use of strncpy is discouraged, use strscpy instead.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/uvc/uvc_driver.c

index 1abc122..30ef2a3 100644 (file)
@@ -1553,7 +1553,7 @@ static int uvc_gpio_parse(struct uvc_device *dev)
        unit->gpio.bmControls[0] = 1;
        unit->get_cur = uvc_gpio_get_cur;
        unit->get_info = uvc_gpio_get_info;
-       strncpy(unit->name, "GPIO", sizeof(unit->name) - 1);
+       strscpy(unit->name, "GPIO", sizeof(unit->name));
 
        list_add_tail(&unit->list, &dev->entities);