mkplanexfw.c:108:21: error: unused variable ‘board’ [-Werror=unused-variable]
mkplanexfw.c:233:24: error: pointer targets in passing argument 2 of ‘sha1_update’ differ in signedness [-Werror=pointer-sign]
mkplanexfw.c:251:2: error: label ‘out_flush’ defined but not used [-Werror=unused-label]
mkplanexfw.c:224:2: error: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Werror=unused-result]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
void usage(int status)
{
FILE *stream = (status != EXIT_SUCCESS) ? stderr : stdout;
- struct board_info *board;
fprintf(stream, "Usage: %s [OPTIONS...]\n", progname);
fprintf(stream,
int buflen;
int err;
struct stat st;
- char *buf;
+ uint8_t *buf;
struct planex_hdr *hdr;
sha1_context ctx;
uint32_t seed;
}
errno = 0;
- fread(buf + sizeof(*hdr), st.st_size, 1, infile);
- if (errno != 0) {
+ size_t r = fread(buf + sizeof(*hdr), st.st_size, 1, infile);
+ if (r != 1 || errno != 0) {
ERRS("unable to read from file %s", ifname);
goto err_close_in;
}
res = EXIT_SUCCESS;
- out_flush:
fflush(outfile);
err_close_out: