aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorTom Rini2024-01-09 17:57:16 -0500
committerTom Rini2024-01-18 20:24:13 -0500
commit21a2c129adaab04a7a032a31c816ae09375fe954 (patch)
treef3239c6612dec5f49afbe2c9b6c9fa598fbb5b10 /common
parentbded9f13b28f10e1248016f1e156ffcea1f6731d (diff)
getchar(): Correct usage
The function getchar() returns an 'int' and not a 'char'. Coverity notes that "Assigning the return value of getchar to char ... truncates its value." and so for the most part we can resolve this easily by using 'int' as intended, and often used throughout the codebase. A few places are not so simple and would require further re-architecting of the code in order to change this, so we leave them be. Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'common')
-rw-r--r--common/cli_readline.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/cli_readline.c b/common/cli_readline.c
index 85453beed76..2507be22952 100644
--- a/common/cli_readline.c
+++ b/common/cli_readline.c
@@ -540,7 +540,7 @@ static int cread_line_simple(const char *const prompt, char *p)
int n = 0; /* buffer index */
int plen = 0; /* prompt length */
int col; /* output column cnt */
- char c;
+ int c;
/* print prompt */
if (prompt) {