diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-02-02 02:48:54 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-06 14:38:13 -0500 |
commit | 4d2079c190558dfa9b766a90a34cb30b8d49c8eb (patch) | |
tree | 7e8946cbc19fde7b974e3ffbc36e0dac7aecb0ba /drivers/usb | |
parent | b11b2e1bdd18ba5cd0dde075d440b3894e6ce64f (diff) |
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')
-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 5b629876941b..92efd6ec48af 100644 --- a/drivers/usb/gadget/f_uvc.c +++ b/drivers/usb/gadget/f_uvc.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/mutex.h> | 18 | #include <linux/mutex.h> |
19 | #include <linux/string.h> | ||
19 | #include <linux/usb/ch9.h> | 20 | #include <linux/usb/ch9.h> |
20 | #include <linux/usb/gadget.h> | 21 | #include <linux/usb/gadget.h> |
21 | #include <linux/usb/video.h> | 22 | #include <linux/usb/video.h> |
@@ -419,7 +420,7 @@ uvc_register_video(struct uvc_device *uvc) | |||
419 | video->parent = &cdev->gadget->dev; | 420 | video->parent = &cdev->gadget->dev; |
420 | video->fops = &uvc_v4l2_fops; | 421 | video->fops = &uvc_v4l2_fops; |
421 | video->release = video_device_release; | 422 | video->release = video_device_release; |
422 | strncpy(video->name, cdev->gadget->name, sizeof(video->name)); | 423 | strlcpy(video->name, cdev->gadget->name, sizeof(video->name)); |
423 | 424 | ||
424 | uvc->vdev = video; | 425 | uvc->vdev = video; |
425 | video_set_drvdata(video, uvc); | 426 | video_set_drvdata(video, uvc); |