diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-05-14 16:01:25 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-05-25 22:33:14 +0300 |
commit | bcab64e8762379d67b7b3bb19ec3884394f10b95 (patch) | |
tree | de930b504a4b8e2ed2c32e2e00935cf3d0c732af /drivers/staging | |
parent | b37705d333c8cf8969ce7ffeb345347a5e7a895f (diff) | |
download | linux-bcab64e8762379d67b7b3bb19ec3884394f10b95.tar.xz |
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: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/media/imx/imx-media-capture.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/media/imx/imx-media-capture.c b/drivers/staging/media/imx/imx-media-capture.c index 0ccabe04b0e1..4e3fdf8aeef5 100644 --- a/drivers/staging/media/imx/imx-media-capture.c +++ b/drivers/staging/media/imx/imx-media-capture.c @@ -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); |