diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-03-01 14:46:33 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:18:23 -0400 |
commit | c3ec830d8925d904f8826d52227d7dfb5dee922c (patch) | |
tree | 59dcd8577027c4b8fd2806d72c0f9d83cc10e860 /drivers/usb/gadget/uvc_v4l2.c | |
parent | 6854bcdc6ff92e3a9c24940a3c5ebb446950c974 (diff) |
usb: gadget: uvc: Use strlcpy instead of strncpy
For NULL terminated string, better notice '\0' in the end.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Bhupesh Sharma <bhupesh.sharma@st.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/uvc_v4l2.c')
-rw-r--r-- | drivers/usb/gadget/uvc_v4l2.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/gadget/uvc_v4l2.c b/drivers/usb/gadget/uvc_v4l2.c index 2bb5af8d2b23..a6c728ab6aba 100644 --- a/drivers/usb/gadget/uvc_v4l2.c +++ b/drivers/usb/gadget/uvc_v4l2.c | |||
@@ -177,9 +177,9 @@ uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) | |||
177 | struct v4l2_capability *cap = arg; | 177 | struct v4l2_capability *cap = arg; |
178 | 178 | ||
179 | memset(cap, 0, sizeof *cap); | 179 | memset(cap, 0, sizeof *cap); |
180 | strncpy(cap->driver, "g_uvc", sizeof(cap->driver)); | 180 | strlcpy(cap->driver, "g_uvc", sizeof(cap->driver)); |
181 | strncpy(cap->card, cdev->gadget->name, sizeof(cap->card)); | 181 | strlcpy(cap->card, cdev->gadget->name, sizeof(cap->card)); |
182 | strncpy(cap->bus_info, dev_name(&cdev->gadget->dev), | 182 | strlcpy(cap->bus_info, dev_name(&cdev->gadget->dev), |
183 | sizeof cap->bus_info); | 183 | sizeof cap->bus_info); |
184 | cap->version = DRIVER_VERSION_NUMBER; | 184 | cap->version = DRIVER_VERSION_NUMBER; |
185 | cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING; | 185 | cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING; |