summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-rpc-ops.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 104bca1ec75..ce06ce2f83a 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -6005,7 +6005,8 @@ cli_to_glusterd (gf_cli_req *req, call_frame_t *frame,
for (i = 0; words[i]; i++) {
strncat (cmd, words[i], strlen (words[i]));
- strncat (cmd, " ", strlen (" "));
+ if (words[i+1] != NULL)
+ strncat (cmd, " ", strlen (" "));
}
cmd [len - 1] = '\0';