media: hdpvr: fix compiler warning
In function 'strncpy', inlined from 'vidioc_g_audio' at media-git/drivers/media/usb/hdpvr/hdpvr-video.c:876:2: media-git/include/linux/string.h:246:9: warning: '__builtin_strncpy' specified bound 32 equals destination size [-Wstringop-truncation] return __builtin_strncpy(p, q, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
fd1857240d
commit
b37705d333
@ -873,7 +873,7 @@ static int vidioc_g_audio(struct file *file, void *private_data,
|
||||
|
||||
audio->index = dev->options.audio_input;
|
||||
audio->capability = V4L2_AUDCAP_STEREO;
|
||||
strncpy(audio->name, audio_iname[audio->index], sizeof(audio->name));
|
||||
strlcpy(audio->name, audio_iname[audio->index], sizeof(audio->name));
|
||||
audio->name[sizeof(audio->name) - 1] = '\0';
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user