diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-10 14:19:14 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-11 19:32:17 +0200 |
commit | c0decac19da3906d9b66291e57b7759489e1170f (patch) | |
tree | 0eeb1f7d2c5464e0c87e0c788fd8fb581662c621 /drivers/media/pci/cx18/cx18-alsa-main.c | |
parent | media: MAINTAINERS: add entry for i.MX PXP media mem2mem driver (diff) | |
download | linux-c0decac19da3906d9b66291e57b7759489e1170f.tar.xz linux-c0decac19da3906d9b66291e57b7759489e1170f.zip |
media: use strscpy() instead of strlcpy()
The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL terminated strings.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci/cx18/cx18-alsa-main.c')
-rw-r--r-- | drivers/media/pci/cx18/cx18-alsa-main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/pci/cx18/cx18-alsa-main.c b/drivers/media/pci/cx18/cx18-alsa-main.c index 93443d1457c5..687477748fdd 100644 --- a/drivers/media/pci/cx18/cx18-alsa-main.c +++ b/drivers/media/pci/cx18/cx18-alsa-main.c @@ -112,7 +112,7 @@ static int snd_cx18_card_set_names(struct snd_cx18_card *cxsc) struct snd_card *sc = cxsc->sc; /* sc->driver is used by alsa-lib's configurator: simple, unique */ - strlcpy(sc->driver, "CX23418", sizeof(sc->driver)); + strscpy(sc->driver, "CX23418", sizeof(sc->driver)); /* sc->shortname is a symlink in /proc/asound: CX18-M -> cardN */ snprintf(sc->shortname, sizeof(sc->shortname), "CX18-%d", |