Skip to content

Commit

Permalink
Open logfiles and cue files in binary mode
Browse files Browse the repository at this point in the history
Windows has long since supported UNIX-style line endings.
To make logfiles reproducable amongst all platforms, standardize "\n"
line endings by opening files in binary mode.
  • Loading branch information
cyanreg committed Apr 7, 2024
1 parent eb219a4 commit 3ea5055
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 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, "wb+");

if (!ctx->cuefile[i]) {
cyanrip_log(ctx, 0, "Couldn't open path \"%s\" for writing: %s!\n"
Expand Down
2 changes: 1 addition & 1 deletion src/cyanrip_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ int cyanrip_log_init(cyanrip_ctx *ctx)
&crip_fmt_info[ctx->settings.outputs[i]],
NULL);

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

if (!ctx->logfile[i]) {
cyanrip_log(ctx, 0, "Couldn't open path \"%s\" for writing: %s!\n"
Expand Down

0 comments on commit 3ea5055

Please sign in to comment.