diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 22:20:42 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 19:32:17 +0200 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/pci/cx23885/cx23885-video.c | |
parent | media: use strscpy() instead of strlcpy() (diff) | |
download | linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.tar.xz linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.zip |
media: replace strcpy() by strscpy()
The strcpy() function is being deprecated upstream. Replace
it by the safer strscpy().
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci/cx23885/cx23885-video.c')
-rw-r--r-- | drivers/media/pci/cx23885/cx23885-video.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index b5ac7a6a9a62..92d32a733f1b 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -639,7 +639,7 @@ static int vidioc_querycap(struct file *file, void *priv, struct cx23885_dev *dev = video_drvdata(file); struct video_device *vdev = video_devdata(file); - strcpy(cap->driver, "cx23885"); + strscpy(cap->driver, "cx23885", sizeof(cap->driver)); strscpy(cap->card, cx23885_boards[dev->board].name, sizeof(cap->card)); sprintf(cap->bus_info, "PCIe:%s", pci_name(dev->pci)); @@ -731,7 +731,7 @@ int cx23885_enum_input(struct cx23885_dev *dev, struct v4l2_input *i) i->index = n; i->type = V4L2_INPUT_TYPE_CAMERA; - strcpy(i->name, iname[INPUT(n)->type]); + strscpy(i->name, iname[INPUT(n)->type], sizeof(i->name)); i->std = CX23885_NORMS; if ((CX23885_VMUX_TELEVISION == INPUT(n)->type) || (CX23885_VMUX_CABLE == INPUT(n)->type)) { @@ -828,7 +828,7 @@ static int cx23885_query_audinput(struct file *file, void *priv, memset(i, 0, sizeof(*i)); i->index = n; - strcpy(i->name, iname[n]); + strscpy(i->name, iname[n], sizeof(i->name)); i->capability = V4L2_AUDCAP_STEREO; return 0; @@ -887,7 +887,7 @@ static int vidioc_g_tuner(struct file *file, void *priv, if (0 != t->index) return -EINVAL; - strcpy(t->name, "Television"); + strscpy(t->name, "Television", sizeof(t->name)); call_all(dev, tuner, g_tuner, t); return 0; @@ -1186,7 +1186,8 @@ int cx23885_video_register(struct cx23885_dev *dev) /* Initialize VBI template */ cx23885_vbi_template = cx23885_video_template; - strcpy(cx23885_vbi_template.name, "cx23885-vbi"); + strscpy(cx23885_vbi_template.name, "cx23885-vbi", + sizeof(cx23885_vbi_template.name)); dev->tvnorm = V4L2_STD_NTSC_M; dev->fmt = format_by_fourcc(V4L2_PIX_FMT_YUYV); |