From a567d764e4561e76708678a7f71f1b837885ff9a Mon Sep 17 00:00:00 2001 From: "U-BIGRED\\markw_000" Date: Sun, 19 Apr 2015 15:17:24 -0700 Subject: [PATCH] Open for read in binary mode on Windows so it doesn't get confused about --- src/shared/s3g_stdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/s3g_stdio.c b/src/shared/s3g_stdio.c index 732113d..b9defcd 100644 --- a/src/shared/s3g_stdio.c +++ b/src/shared/s3g_stdio.c @@ -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) {