diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-02-02 07:48:54 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-06 19:38:13 (GMT) |
commit | 4d2079c190558dfa9b766a90a34cb30b8d49c8eb (patch) | |
tree | 7e8946cbc19fde7b974e3ffbc36e0dac7aecb0ba /drivers/usb/gadget | |
parent | b11b2e1bdd18ba5cd0dde075d440b3894e6ce64f (diff) | |
download | linux-fsl-qoriq-4d2079c190558dfa9b766a90a34cb30b8d49c8eb.tar.xz |
drivers/usb/gadget: using strlcpy instead of strncpy
for NUL terminated string, better notice '\0' in the end.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/f_uvc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c index 5b62987..92efd6e 100644 --- a/drivers/usb/gadget/f_uvc.c +++ b/drivers/usb/gadget/f_uvc.c @@ -16,6 +16,7 @@ #include <linux/fs.h> #include <linux/list.h> #include <linux/mutex.h> +#include <linux/string.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> #include <linux/usb/video.h> @@ -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); |