The tools will no longer crash if the "firmware" file is
a directory.
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
err = fread(file->data, file->len, 1, fh);
if (err != 1)
- return ferror(fh);
+ return -ferror(fh);
file->name = strdup(name);
fclose(fh);
err = fwrite(iter->data, elen, 1, fh);
if (err != 1) {
- err = ferror(fh);
+ err = -ferror(fh);
goto close_out;
}
}
err = fwrite(&last_desc, sizeof(last_desc), 1, fh);
if (err != 1) {
- err = ferror(fh);
+ err = -ferror(fh);
goto close_out;
}