Handling failure to write to disk file. Coverity CID 21786.
This commit is contained in:
parent
8e40849678
commit
88d9f38385
@ -714,8 +714,16 @@ int telltoc_read_and_print(struct burn_drive *drive,
|
|||||||
print_result:;
|
print_result:;
|
||||||
total_count += data_count;
|
total_count += data_count;
|
||||||
if (encoding == 1) {
|
if (encoding == 1) {
|
||||||
if (data_count > 0)
|
if (data_count > 0) {
|
||||||
fwrite(buf, data_count, 1, raw_fp);
|
ret = fwrite(buf, data_count, 1, raw_fp);
|
||||||
|
if (ret < 1) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"FAILURE: writing to '%s' : %s\n",
|
||||||
|
raw_file, strerror(errno));
|
||||||
|
fclose(raw_fp);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
} else for (i = 0; i < data_count; i += 16) {
|
} else for (i = 0; i < data_count; i += 16) {
|
||||||
if (encoding == 0) {
|
if (encoding == 0) {
|
||||||
sprintf(line, "%8ds + %4d : ",
|
sprintf(line, "%8ds + %4d : ",
|
||||||
|
Loading…
Reference in New Issue
Block a user