diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 23:20:42 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 20:32:17 +0300 |
commit | cc1e6315e83db0e517dd9279050b88adc83a7eba (patch) | |
tree | 2fab5c7b2a4f3f50a045357a41c419fccc975de2 /drivers/media/usb/cpia2 | |
parent | c0decac19da3906d9b66291e57b7759489e1170f (diff) | |
download | linux-cc1e6315e83db0e517dd9279050b88adc83a7eba.tar.xz |
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/usb/cpia2')
-rw-r--r-- | drivers/media/usb/cpia2/cpia2_v4l.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 99f106b13280..aa7f3c307b22 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -219,12 +219,12 @@ static int cpia2_querycap(struct file *file, void *fh, struct v4l2_capability *v { struct camera_data *cam = video_drvdata(file); - strcpy(vc->driver, "cpia2"); + strscpy(vc->driver, "cpia2", sizeof(vc->driver)); if (cam->params.pnp_id.product == 0x151) - strcpy(vc->card, "QX5 Microscope"); + strscpy(vc->card, "QX5 Microscope", sizeof(vc->card)); else - strcpy(vc->card, "CPiA2 Camera"); + strscpy(vc->card, "CPiA2 Camera", sizeof(vc->card)); switch (cam->params.pnp_id.device_type) { case DEVICE_STV_672: strcat(vc->card, " (672/"); @@ -281,7 +281,7 @@ static int cpia2_enum_input(struct file *file, void *fh, struct v4l2_input *i) { if (i->index) return -EINVAL; - strcpy(i->name, "Camera"); + strscpy(i->name, "Camera", sizeof(i->name)); i->type = V4L2_INPUT_TYPE_CAMERA; return 0; } @@ -319,11 +319,11 @@ static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh, f->flags = V4L2_FMT_FLAG_COMPRESSED; switch(index) { case 0: - strcpy(f->description, "MJPEG"); + strscpy(f->description, "MJPEG", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_MJPEG; break; case 1: - strcpy(f->description, "JPEG"); + strscpy(f->description, "JPEG", sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_JPEG; break; default: |