From 9895baf2719ac9911bc20ca54d0ff84f761baaed Mon Sep 17 00:00:00 2001 From: Kaushik BV Date: Fri, 16 Sep 2011 14:03:40 +0530 Subject: cli: check wordcount to validate volume set help Change-Id: I93650af9fb29cffc48733d9bba5fd2fb580c44a1 BUG: 3543 Reviewed-on: http://review.gluster.com/436 Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- cli/src/cli-cmd-parser.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 92626df76..a8ac54106 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -643,10 +643,13 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options) ret = dict_set_str (dict, "volname", volname); - if (!strcmp (volname, "help") && !words[3] && !words[4]) + if (ret) + goto out; + + if (!strcmp (volname, "help") && wordcount == 3 ) ret = dict_set_str (dict, "help", volname); - if (!strcmp (volname, "help-xml") && !words[3] && !words[4]) + if (!strcmp (volname, "help-xml") && wordcount == 3 ) ret = dict_set_str (dict, "help-xml", volname); if (ret) -- cgit