Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
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;
break;
case CSUM_TYPE_32:
ret = csum32_get(css);
+ break;
+ default:
+ ERR("invalid checksum size\n");
+ return 0;
}
return ret;
res = write_out_data(outfile, (uint8_t *)&tmp.nfs,
sizeof(tmp.nfs), NULL);
break;
+ default:
+ ERR("invalid header type\n");
+ return -EINVAL;
}
return res;
case CSUM_SIZE_16:
ret = csum16_get(css);
break;
+ default:
+ ERR("invalid checksum size\n");
+ return 0;
}
return ret;
int fixmode = 0;
int have_regionversion = 0;
- FILE *ifile, *ofile;
+ FILE *ifile = NULL;
+ FILE *ofile = NULL;
int c;
uint32_t cksum;
uint32_t bcnt;
char region[MAX_REG_LEN];
int kernel = 0;
- FILE *ifile, *ofile;
+ FILE *ifile = NULL;
+ FILE *ofile = NULL;
int c;
uint32_t cksum;
main(int argc, char **argv)
{
int opt;
- char *filename, *progname;
+ char *filename = NULL;
+ char *progname;
op_mode_t opmode = NONE;
progname = argv[0];