[lvm-devel] master - lvm shell: clear argv for each command
David Teigland
teigland at fedoraproject.org
Mon Feb 13 18:10:35 UTC 2017
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9a0f0c70bf59a5cd07828ff39e5ff04b4a5411ad
Commit: 9a0f0c70bf59a5cd07828ff39e5ff04b4a5411ad
Parent: 23a1ced4397b699ae572570ec772683d7003de6f
Author: David Teigland <teigland at redhat.com>
AuthorDate: Fri Jan 13 12:02:06 2017 -0600
Committer: David Teigland <teigland at redhat.com>
CommitterDate: Mon Feb 13 08:20:10 2017 -0600
lvm shell: clear argv for each command
---
tools/lvm.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tools/lvm.c b/tools/lvm.c
index aae6da0..5fd9918 100644
--- a/tools/lvm.c
+++ b/tools/lvm.c
@@ -210,7 +210,7 @@ int lvm_shell(struct cmd_context *cmd, struct cmdline_context *cmdline)
{
log_report_t saved_log_report_state = log_get_report_state();
char *orig_command_log_selection = NULL;
- int is_lastlog_cmd = 0, argc, ret;
+ int is_lastlog_cmd = 0, argc, ret, i;
char *input = NULL, *args[MAX_ARGS], **argv;
rl_readline_name = "lvm";
@@ -262,6 +262,9 @@ int lvm_shell(struct cmd_context *cmd, struct cmdline_context *cmdline)
add_history(input);
+ for (i = 0; i < MAX_ARGS; i++)
+ args[i] = NULL;
+
argv = args;
if (lvm_split(input, &argc, argv, MAX_ARGS) == MAX_ARGS) {
More information about the lvm-devel
mailing list