Skip to content

Commit

Permalink
Open for read in binary mode on Windows so it doesn't get confused ab…
Browse files Browse the repository at this point in the history
…out <CTRL-Z>
  • Loading branch information
markwal committed Apr 19, 2015
1 parent e68210a commit a567d76
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/shared/s3g_stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,10 @@ int s3g_stdio_open(s3g_context_t *ctx, const char *src, int create_file, int mod
{
const char *fname = (const char *)src;
int oflag = create_file ? O_CREAT | O_WRONLY : O_RDONLY;
#ifdef O_BINARY
if (!create_file)
oflag |= O_BINARY;
#endif
int fd = open(fname, oflag, mode);
if (fd < 0)
{
Expand Down

0 comments on commit a567d76

Please sign in to comment.