Skip to content

Commit

Permalink
Handle logfile/cuefile creation failure
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanreg committed Apr 7, 2024
1 parent 8f15276 commit eb219a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cue_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int cyanrip_cue_init(cyanrip_ctx *ctx)
&crip_fmt_info[ctx->settings.outputs[i]],
NULL);

ctx->cuefile[i] = fopen(cuefile, "w");
ctx->cuefile[i] = fopen(cuefile, "w+");

if (!ctx->cuefile[i]) {
cyanrip_log(ctx, 0, "Couldn't open path \"%s\" for writing: %s!\n"
Expand Down
4 changes: 2 additions & 2 deletions src/cyanrip_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1935,9 +1935,9 @@ int main(int argc, char **argv)

/* Create log file */
if (!ctx->settings.print_info_only) {
if (cyanrip_log_init(ctx) < 0)
if (cyanrip_log_init(ctx))
return 1;
if (cyanrip_cue_init(ctx) < 0)
if (cyanrip_cue_init(ctx))
return 1;
} else {
cyanrip_log(ctx, 0, "Log(s) will be written to:\n");
Expand Down

0 comments on commit eb219a4

Please sign in to comment.