提交 bcab64e8 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

media: imx: fix compiler warning

drivers/staging/media/imx/imx-media-capture.c: In function 'vidioc_querycap':
drivers/staging/media/imx/imx-media-capture.c:76:2: warning: 'strncpy' output truncated copying 15 bytes from a string of length 17 [-Wstringop-truncation]
  strncpy(cap->driver, "imx-media-capture", sizeof(cap->driver) - 1);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Acked-by: NSteve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 b37705d3
......@@ -73,8 +73,8 @@ static int vidioc_querycap(struct file *file, void *fh,
{
struct capture_priv *priv = video_drvdata(file);
strncpy(cap->driver, "imx-media-capture", sizeof(cap->driver) - 1);
strncpy(cap->card, "imx-media-capture", sizeof(cap->card) - 1);
strlcpy(cap->driver, "imx-media-capture", sizeof(cap->driver));
strlcpy(cap->card, "imx-media-capture", sizeof(cap->card));
snprintf(cap->bus_info, sizeof(cap->bus_info),
"platform:%s", priv->src_sd->name);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册