media: replace strncpy() by strscpy()
The strncpy() function is being deprecated upstream. Replace it by the safer strscpy(). While here, replace a few occurences of strlcpy() that were recently added to also use strscpy(). Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
@@ -412,7 +412,7 @@ static int vidioc_enum_input(struct file *file, void *fh,
|
||||
if (inp->index != 0)
|
||||
return -EINVAL;
|
||||
|
||||
strlcpy(inp->name, "camera", sizeof(inp->name));
|
||||
strscpy(inp->name, "camera", sizeof(inp->name));
|
||||
inp->type = V4L2_INPUT_TYPE_CAMERA;
|
||||
|
||||
return 0;
|
||||
@@ -644,7 +644,7 @@ int sun6i_video_init(struct sun6i_video *video, struct sun6i_csi *csi,
|
||||
}
|
||||
|
||||
/* Register video device */
|
||||
strlcpy(vdev->name, name, sizeof(vdev->name));
|
||||
strscpy(vdev->name, name, sizeof(vdev->name));
|
||||
vdev->release = video_device_release_empty;
|
||||
vdev->fops = &sun6i_video_fops;
|
||||
vdev->ioctl_ops = &sun6i_video_ioctl_ops;
|
||||
|
Reference in New Issue
Block a user