firmware-utils: fix -Wmaybe-uninitialized warnings

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
Rafał Miłecki 2021-04-09 09:21:25 +02:00
parent a2f6622945
commit 052a30d65e
6 changed files with 18 additions and 4 deletions

View File

@ -150,7 +150,8 @@ static void usage() {
int main(int argc, char **argv) {
struct trx_header hdr;
struct asustrx_tail tail = { };
FILE *in, *out;
FILE *out = NULL;
FILE *in = NULL;
uint8_t buf[1024];
size_t bytes;
size_t length = 0;

View File

@ -554,6 +554,10 @@ csum_get(struct csum_state *css)
break;
case CSUM_TYPE_32:
ret = csum32_get(css);
break;
default:
ERR("invalid checksum size\n");
return 0;
}
return ret;
@ -755,6 +759,9 @@ write_out_header(FILE *outfile)
res = write_out_data(outfile, (uint8_t *)&tmp.nfs,
sizeof(tmp.nfs), NULL);
break;
default:
ERR("invalid header type\n");
return -EINVAL;
}
return res;

View File

@ -493,6 +493,9 @@ csum_get(struct csum_state *css)
case CSUM_SIZE_16:
ret = csum16_get(css);
break;
default:
ERR("invalid checksum size\n");
return 0;
}
return ret;

View File

@ -68,7 +68,8 @@ main(int ac, char *av[])
int fixmode = 0;
int have_regionversion = 0;
FILE *ifile, *ofile;
FILE *ifile = NULL;
FILE *ofile = NULL;
int c;
uint32_t cksum;
uint32_t bcnt;

View File

@ -92,7 +92,8 @@ main(int ac, char *av[])
char region[MAX_REG_LEN];
int kernel = 0;
FILE *ifile, *ofile;
FILE *ifile = NULL;
FILE *ofile = NULL;
int c;
uint32_t cksum;

View File

@ -251,7 +251,8 @@ int
main(int argc, char **argv)
{
int opt;
char *filename, *progname;
char *filename = NULL;
char *progname;
op_mode_t opmode = NONE;
progname = argv[0];