Commit b37705d3 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent fd185724
No related merge requests found
...@@ -873,7 +873,7 @@ static int vidioc_g_audio(struct file *file, void *private_data, ...@@ -873,7 +873,7 @@ static int vidioc_g_audio(struct file *file, void *private_data,
audio->index = dev->options.audio_input; audio->index = dev->options.audio_input;
audio->capability = V4L2_AUDCAP_STEREO; 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'; audio->name[sizeof(audio->name) - 1] = '\0';
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment