diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-01-17 15:26:59 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-01-17 15:26:59 +0100 |
commit | 855ac46351258cf19c527d8df3a411ad6ed889ee (patch) | |
tree | 374489f850f618e0c2bb6945910e16805e18b2b4 /linux/drivers/media/video/v4l2-common.c | |
parent | d107857629bfa2b5779eb6d017178616513d57b8 (diff) | |
download | mediapointer-dvb-s2-855ac46351258cf19c527d8df3a411ad6ed889ee.tar.gz mediapointer-dvb-s2-855ac46351258cf19c527d8df3a411ad6ed889ee.tar.bz2 |
v4l2: replace a few snprintfs with strlcpy
From: Hans Verkuil <hverkuil@xs4all.nl>
Priority: normal
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/v4l2-common.c')
-rw-r--r-- | linux/drivers/media/video/v4l2-common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/linux/drivers/media/video/v4l2-common.c b/linux/drivers/media/video/v4l2-common.c index 27af4d97a..7f556bea4 100644 --- a/linux/drivers/media/video/v4l2-common.c +++ b/linux/drivers/media/video/v4l2-common.c @@ -556,7 +556,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste qctrl->step = step; qctrl->default_value = def; qctrl->reserved[0] = qctrl->reserved[1] = 0; - snprintf(qctrl->name, sizeof(qctrl->name), name); + strlcpy(qctrl->name, name, sizeof(qctrl->name)); return 0; } EXPORT_SYMBOL(v4l2_ctrl_query_fill); @@ -721,7 +721,7 @@ int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qc for (i = 0; i < qmenu->index && menu_items[i]; i++) ; if (menu_items[i] == NULL || menu_items[i][0] == '\0') return -EINVAL; - snprintf(qmenu->name, sizeof(qmenu->name), menu_items[qmenu->index]); + strlcpy(qmenu->name, menu_items[qmenu->index], sizeof(qmenu->name)); return 0; } EXPORT_SYMBOL(v4l2_ctrl_query_menu); @@ -738,8 +738,8 @@ int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *id return -EINVAL; while (*ids != V4L2_CTRL_MENU_IDS_END) { if (*ids++ == qmenu->index) { - snprintf(qmenu->name, sizeof(qmenu->name), - menu_items[qmenu->index]); + strlcpy(qmenu->name, menu_items[qmenu->index], + sizeof(qmenu->name)); return 0; } } |