mirror of
https://github.com/openwrt/openwrt.git
synced 2024-11-25 19:04:51 +08:00
firmware-utils: fix -Wmaybe-uninitialized warnings
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
This commit is contained in:
parent
a2f6622945
commit
052a30d65e
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user