Mesa (master): os: Open file streams in binary mode.

Michał Król michal at kemper.freedesktop.org
Mon Nov 8 16:25:33 UTC 2010


Module: Mesa
Branch: master
Commit: 9e7132b52debd3d592391ce89d3582027cb0e161
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e7132b52debd3d592391ce89d3582027cb0e161

Author: Michal Krol <michal at vmware.com>
Date:   Mon Nov  8 17:23:32 2010 +0100

os: Open file streams in binary mode.

Otherwise we'll get garbled data on Windows.

---

 src/gallium/auxiliary/os/os_stream_stdc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/os/os_stream_stdc.c b/src/gallium/auxiliary/os/os_stream_stdc.c
index 37e7d06..afd3ff6 100644
--- a/src/gallium/auxiliary/os/os_stream_stdc.c
+++ b/src/gallium/auxiliary/os/os_stream_stdc.c
@@ -106,7 +106,7 @@ os_file_stream_create(const char *filename)
    stream->base.flush = &os_stdc_stream_flush;
    stream->base.vprintf = &os_stdc_stream_vprintf;
 
-   stream->file = fopen(filename, "w");
+   stream->file = fopen(filename, "wb");
    if(!stream->file)
       goto no_file;
 




More information about the mesa-commit mailing list