From 4d2079c190558dfa9b766a90a34cb30b8d49c8eb Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Sat, 2 Feb 2013 15:48:54 +0800 Subject: [PATCH] drivers/usb/gadget: using strlcpy instead of strncpy for NUL terminated string, better notice '\0' in the end. Signed-off-by: Chen Gang Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/f_uvc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c index 5b629876941b..92efd6ec48af 100644 --- a/drivers/usb/gadget/f_uvc.c +++ b/drivers/usb/gadget/f_uvc.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -419,7 +420,7 @@ uvc_register_video(struct uvc_device *uvc) video->parent = &cdev->gadget->dev; video->fops = &uvc_v4l2_fops; video->release = video_device_release; - strncpy(video->name, cdev->gadget->name, sizeof(video->name)); + strlcpy(video->name, cdev->gadget->name, sizeof(video->name)); uvc->vdev = video; video_set_drvdata(video, uvc); -- 2.39.5