diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-01-17 09:26:59 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:22 -0400 |
commit | b634a93f783dbd4be31f3cc9b2292eddfb496d10 (patch) | |
tree | d60edacfdd3c54269b780f901da33ff30e797f78 /drivers/media/video/v4l2-common.c | |
parent | e32a7eccd7f016928dd864711ac654e6db62c5f3 (diff) |
V4L/DVB (10244): v4l2: replace a few snprintfs with strlcpy
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r-- | drivers/media/video/v4l2-common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index b8f2be8d5c0e..0f450a73477a 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
@@ -555,7 +555,7 @@ int v4l2_ctrl_query_fill(struct v4l2_queryctrl *qctrl, s32 min, s32 max, s32 ste | |||
555 | qctrl->step = step; | 555 | qctrl->step = step; |
556 | qctrl->default_value = def; | 556 | qctrl->default_value = def; |
557 | qctrl->reserved[0] = qctrl->reserved[1] = 0; | 557 | qctrl->reserved[0] = qctrl->reserved[1] = 0; |
558 | snprintf(qctrl->name, sizeof(qctrl->name), name); | 558 | strlcpy(qctrl->name, name, sizeof(qctrl->name)); |
559 | return 0; | 559 | return 0; |
560 | } | 560 | } |
561 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); | 561 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); |
@@ -720,7 +720,7 @@ int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu, struct v4l2_queryctrl *qc | |||
720 | for (i = 0; i < qmenu->index && menu_items[i]; i++) ; | 720 | for (i = 0; i < qmenu->index && menu_items[i]; i++) ; |
721 | if (menu_items[i] == NULL || menu_items[i][0] == '\0') | 721 | if (menu_items[i] == NULL || menu_items[i][0] == '\0') |
722 | return -EINVAL; | 722 | return -EINVAL; |
723 | snprintf(qmenu->name, sizeof(qmenu->name), menu_items[qmenu->index]); | 723 | strlcpy(qmenu->name, menu_items[qmenu->index], sizeof(qmenu->name)); |
724 | return 0; | 724 | return 0; |
725 | } | 725 | } |
726 | EXPORT_SYMBOL(v4l2_ctrl_query_menu); | 726 | EXPORT_SYMBOL(v4l2_ctrl_query_menu); |
@@ -737,8 +737,8 @@ int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 *id | |||
737 | return -EINVAL; | 737 | return -EINVAL; |
738 | while (*ids != V4L2_CTRL_MENU_IDS_END) { | 738 | while (*ids != V4L2_CTRL_MENU_IDS_END) { |
739 | if (*ids++ == qmenu->index) { | 739 | if (*ids++ == qmenu->index) { |
740 | snprintf(qmenu->name, sizeof(qmenu->name), | 740 | strlcpy(qmenu->name, menu_items[qmenu->index], |
741 | menu_items[qmenu->index]); | 741 | sizeof(qmenu->name)); |
742 | return 0; | 742 | return 0; |
743 | } | 743 | } |
744 | } | 744 | } |