diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 08:19:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-03-29 10:26:13 -0400 |
commit | 85709cbf152465c77a9c2de48a6f4ef23c8c3d83 (patch) | |
tree | 4dc492b6da48d0d1f9ede150c0c2386f4efb6438 /drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | |
parent | 060162c1af5cd807384247cc95a0d5cb016e316a (diff) | |
download | lwn-85709cbf152465c77a9c2de48a6f4ef23c8c3d83.tar.gz lwn-85709cbf152465c77a9c2de48a6f4ef23c8c3d83.zip |
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>
Diffstat (limited to 'drivers/media/usb/pvrusb2/pvrusb2-v4l2.c')
-rw-r--r-- | drivers/media/usb/pvrusb2/pvrusb2-v4l2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c index 08d5b7aa3537..cb6668580d77 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-v4l2.c @@ -284,7 +284,7 @@ static int pvr2_enumaudio(struct file *file, void *priv, struct v4l2_audio *vin) if (vin->index > 0) return -EINVAL; - strncpy(vin->name, "PVRUSB2 Audio", 14); + strscpy(vin->name, "PVRUSB2 Audio", sizeof(vin->name)); vin->capability = V4L2_AUDCAP_STEREO; return 0; } @@ -293,7 +293,7 @@ static int pvr2_g_audio(struct file *file, void *priv, struct v4l2_audio *vin) { /* pkt: FIXME: see above comment (VIDIOC_ENUMAUDIO) */ vin->index = 0; - strncpy(vin->name, "PVRUSB2 Audio", 14); + strscpy(vin->name, "PVRUSB2 Audio", sizeof(vin->name)); vin->capability = V4L2_AUDCAP_STEREO; return 0; } |