summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-cmd-parser.c')
-rw-r--r--cli/src/cli-cmd-parser.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index daec9c8d6..479df9386 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -322,12 +322,16 @@ cli_cmd_volume_set_parse (const char **words, int wordcount, dict_t **options)
if (ret)
goto out;
- for (i = 3; i < wordcount; i++) {
- key = strtok ((char *)words[i], "=");
- value = strtok (NULL, "=");
-
- GF_ASSERT (key);
- GF_ASSERT (value);
+ for (i = 3; i < wordcount; i+=2) {
+
+ key = (char *) words[i];
+ value = (char *) words[i+1];
+
+ if ( !key || !value) {
+ ret = -1;
+ cli_out ("Usage: volume set <VOLNAME> <KEY> <VALUE>");
+ goto out;
+ }
count++;