fix -Wunused-result errors

This commit is contained in:
linuxwhata 2025-03-21 00:26:50 +08:00 committed by A1ive
parent 533c96375e
commit 57d3c32c6d

View File

@ -47,7 +47,12 @@ main (int argc, char *argv[])
buf = (char *) malloc (file_size);
assert (buf);
fread (buf, file_size, 1, f_input);
if (fread (buf, file_size, 1, f_input) != 1)
{
fprintf (stderr, "read %s failed\n", argv[1]);
fclose (f_input);
return -1;
}
fclose (f_input);
f_output = fopen (argv[2], "w");