diff options
author | Xavi Hernandez <xhernandez@redhat.com> | 2018-07-06 20:23:35 +0200 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2018-07-10 16:28:24 +0200 |
commit | 6dc5dfef819cad69d6d4b4c1c305efa74236ad84 (patch) | |
tree | 6b325caf478689d8113279191ca1916e5f5b32ea /cli/src | |
parent | 03f1f5bdc46076178f1afdf8e2a76c5b973fe11f (diff) |
Fix compile warnings
This patch fixes compile warnings that appear with newer compilers. The
solution applied is only to remove the warnings, but it doesn't always
solve the problem in the best way. It assumes that the problem will never
happen, as the previous code assumed.
Change-Id: I6e8470d6c2e2dbd3bd7d324b5fd2f92ffdc3d6ec
updates: bz#1193929
Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'cli/src')
-rw-r--r-- | cli/src/cli-rpc-ops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 8da3fc8aa6c..602267b06a2 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -8240,8 +8240,8 @@ cli_print_volume_status_tasks (dict_t *dict) char *op = NULL; char *task_id_str = NULL; char *volname = NULL; - char key[1024] = {0,}; - char task[1024] = {0,}; + char key[64] = {0,}; + char task[32] = {0,}; char *brick = NULL; ret = dict_get_str (dict, "volname", &volname); @@ -10627,7 +10627,7 @@ gf_cli_generate_snapshot_event (gf_cli_rsp *rsp, dict_t *dict, char *auto_delete = NULL; char *snap_activate = NULL; char msg[PATH_MAX] = {0, }; - char option[PATH_MAX] = {0, }; + char option[512] = {0, }; GF_VALIDATE_OR_GOTO ("cli", dict, out); GF_VALIDATE_OR_GOTO ("cli", rsp, out); @@ -11846,9 +11846,9 @@ 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, words[i], len - 1); if (words[i+1] != NULL) - strncat (cmd, " ", strlen (" ")); + strncat (cmd, " ", len - 1); } cmd [len - 1] = '\0'; |