summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorNandaja Varma <nandaja.varma@gmail.com>2015-02-17 17:27:03 +0530
committerVijay Bellur <vbellur@redhat.com>2015-04-04 10:53:42 -0700
commit5e7cc20d3cc37a03f594237bdf85c67397c3ceac (patch)
treed09d8dc89e427c64ab21e0cd906fff1de42f0f06 /cli
parentf7a14c0fe5fe92fc6ebaf37322748918a57afef8 (diff)
cli: Removing negative value check for unsigned variable (coverity fix)
CID: 1124663 Change-Id: Ic24014cdb9a68ed310c5e3dcf21fcebd6bf9da60 BUG: 789278 Signed-off-by: Nandaja Varma <nandaja.varma@gmail.com> Reviewed-on: http://review.gluster.org/9669 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 1c2e14c7a5e..7c03ae228fd 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -2582,7 +2582,7 @@ cli_cmd_volume_top_parse (const char **words, int wordcount,
int32_t list_cnt = -1;
int index = 0;
int perf = 0;
- uint32_t blk_size = 0;
+ int32_t blk_size = 0;
uint32_t count = 0;
gf_boolean_t nfs = _gf_false;
char *delimiter = NULL;
@@ -2703,7 +2703,8 @@ cli_cmd_volume_top_parse (const char **words, int wordcount,
ret = -1;
goto out;
}
- ret = dict_set_uint32 (dict, "blk-size", blk_size);
+ ret = dict_set_uint32 (dict, "blk-size",
+ (uint32_t)blk_size);
} else if (perf && !nfs && !strcmp (key, "count")) {
ret = gf_is_str_int (value);
if (!ret)