Skip to content

Commit

Permalink
verify: open state file in binary mode on Windows
Browse files Browse the repository at this point in the history
Make sure we open the verify state file in binary mode to avoid any
possible conversion of NL to CR+NL. This is the same fix we did for
1fb215e.

Fixes: #1631
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
  • Loading branch information
vincentkfu committed Sep 14, 2023
1 parent e4a9812 commit e2c5f17
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,10 @@ static int open_state_file(const char *name, const char *prefix, int num,
else
flags = O_RDONLY;

#ifdef _WIN32
flags |= O_BINARY;
#endif

verify_state_gen_name(out, sizeof(out), name, prefix, num);

fd = open(out, flags, 0644);
Expand Down

0 comments on commit e2c5f17

Please sign in to comment.