Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d2079c1 authored by Chen Gang's avatar Chen Gang Committed by Greg Kroah-Hartman
Browse files

drivers/usb/gadget: using strlcpy instead of strncpy



  for NUL terminated string, better notice '\0' in the end.

Signed-off-by: default avatarChen Gang <gang.chen@asianux.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b11b2e1b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);