aboutsummaryrefslogtreecommitdiff
path: root/cmd/load.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-01-09 17:57:16 -0500
committerTom Rini <trini@konsulko.com>2024-01-18 20:24:13 -0500
commit21a2c129adaab04a7a032a31c816ae09375fe954 (patch)
treef3239c6612dec5f49afbe2c9b6c9fa598fbb5b10 /cmd/load.c
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 'cmd/load.c')
-rw-r--r--cmd/load.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/load.c b/cmd/load.c
index 2715cf5957..540361b43f 100644
--- a/cmd/load.c
+++ b/cmd/load.c
@@ -230,7 +230,7 @@ static ulong load_serial(long offset)
static int read_record(char *buf, ulong len)
{
char *p;
- char c;
+ int c;
--len; /* always leave room for terminating '\0' byte */
@@ -827,7 +827,7 @@ static void handle_send_packet(int n)
/* k_recv receives a OS Open image file over kermit line */
static int k_recv(void)
{
- char new_char;
+ int new_char;
char k_state, k_state_saved;
int sum;
int done;