diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-07-15 19:42:32 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-07-15 19:42:32 +0300 |
commit | ecb41832bd2a7a3f8ac93527cec5e51e3827daed (patch) | |
tree | a382a3719eca9ac8a22ae7f1715d0bd4843dc8e2 /drivers/media/usb/hdpvr/hdpvr-video.c | |
parent | d38b6cf50a6b911ee46683330f3af17fcceca509 (diff) | |
parent | 0ecfebd2b52404ae0c54a878c872bb93363ada36 (diff) | |
download | linux-ecb41832bd2a7a3f8ac93527cec5e51e3827daed.tar.xz |
Merge tag 'v5.2' into next
Sync up with mainline to resolve conflicts in iforce driver.
Diffstat (limited to 'drivers/media/usb/hdpvr/hdpvr-video.c')
-rw-r--r-- | drivers/media/usb/hdpvr/hdpvr-video.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c index e082086428a4..7580fc5f2f12 100644 --- a/drivers/media/usb/hdpvr/hdpvr-video.c +++ b/drivers/media/usb/hdpvr/hdpvr-video.c @@ -1,12 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Hauppauge HD PVR USB driver - video 4 linux 2 interface * * Copyright (C) 2008 Janne Grunau (j@jannau.net) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, version 2. - * */ #include <linux/kernel.h> @@ -769,8 +765,7 @@ static int vidioc_enum_input(struct file *file, void *_fh, struct v4l2_input *i) i->type = V4L2_INPUT_TYPE_CAMERA; - strncpy(i->name, iname[n], sizeof(i->name) - 1); - i->name[sizeof(i->name) - 1] = '\0'; + strscpy(i->name, iname[n], sizeof(i->name)); i->audioset = 1<<HDPVR_RCA_FRONT | 1<<HDPVR_RCA_BACK | 1<<HDPVR_SPDIF; @@ -841,8 +836,7 @@ static int vidioc_enumaudio(struct file *file, void *priv, audio->capability = V4L2_AUDCAP_STEREO; - strncpy(audio->name, audio_iname[n], sizeof(audio->name) - 1); - audio->name[sizeof(audio->name) - 1] = '\0'; + strscpy(audio->name, audio_iname[n], sizeof(audio->name)); return 0; } @@ -874,7 +868,6 @@ static int vidioc_g_audio(struct file *file, void *private_data, audio->index = dev->options.audio_input; audio->capability = V4L2_AUDCAP_STEREO; strscpy(audio->name, audio_iname[audio->index], sizeof(audio->name)); - audio->name[sizeof(audio->name) - 1] = '\0'; return 0; } @@ -991,7 +984,8 @@ static int vidioc_enum_fmt_vid_cap(struct file *file, void *private_data, return -EINVAL; f->flags = V4L2_FMT_FLAG_COMPRESSED; - strncpy(f->description, "MPEG2-TS with AVC/AAC streams", 32); + strscpy(f->description, "MPEG2-TS with AVC/AAC streams", + sizeof(f->description)); f->pixelformat = V4L2_PIX_FMT_MPEG; return 0; |