projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b76846
)
[media] coda: use strlcpy instead of snprintf
author
Philipp Zabel
<
[email protected]
>
Tue, 24 Mar 2015 17:30:50 +0000
(14:30 -0300)
committer
Mauro Carvalho Chehab
<
[email protected]
>
Fri, 10 Apr 2015 13:05:50 +0000
(10:05 -0300)
There is no need to take the detour through a "%s" format string
to create a copy of a string.
Signed-off-by: Philipp Zabel <
[email protected]
>
Signed-off-by: Kamil Debski <
[email protected]
>
Signed-off-by: Mauro Carvalho Chehab <
[email protected]
>
drivers/media/platform/coda/coda-common.c
patch
|
blob
|
history
diff --git
a/drivers/media/platform/coda/coda-common.c
b/drivers/media/platform/coda/coda-common.c
index 2906dd22514304467d456f9556118d5a69ea8d2b..443886535230ee034835eaef0967382b0f8b337e 100644
(file)
--- a/
drivers/media/platform/coda/coda-common.c
+++ b/
drivers/media/platform/coda/coda-common.c
@@
-1915,8
+1915,7
@@
static int coda_register_device(struct coda_dev *dev, int i)
if (i >= dev->devtype->num_vdevs)
return -EINVAL;
- snprintf(vfd->name, sizeof(vfd->name), "%s",
- dev->devtype->vdevs[i]->name);
+ strlcpy(vfd->name, dev->devtype->vdevs[i]->name, sizeof(vfd->name));
vfd->fops = &coda_fops;
vfd->ioctl_ops = &coda_ioctl_ops;
vfd->release = video_device_release_empty,