From 27b04b6c487e789074eb10c93be0f7d4f58fa945 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Fri, 5 May 2017 16:01:36 +0200 Subject: Fix 'flush' type, coverity warning As getchar returna a int, (which is 4 bytes on most common platforms, and at least 2 bytes), and char being often 1 byte, the conversion would lose information, hence the warning. Change-Id: I5b0b39c636ff49ef5c15d51a7f798e21635eca06 BUG: 789278 Signed-off-by: Michael Scherer Reviewed-on: https://review.gluster.org/17193 Tested-by: Michael Scherer Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Prashanth Pai CentOS-regression: Gluster Build System Reviewed-by: Zhou Zhengping Reviewed-by: Jeff Darcy --- cli/src/cli-cmd-volume.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 5f07a057d47..61b6b2090a9 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -407,7 +407,7 @@ gf_answer_t cli_cmd_get_confirmation (struct cli_state *state, const char *question) { char answer[5] = {'\0', }; - char flush = '\0'; + int flush = '\0'; size_t len; if (state->mode & GLUSTER_MODE_SCRIPT) -- cgit