os: Open file streams in binary mode.
authorMichal Krol <michal@vmware.com>
Mon, 8 Nov 2010 16:23:32 +0000 (17:23 +0100)
committerMichal Krol <michal@vmware.com>
Mon, 8 Nov 2010 16:24:11 +0000 (17:24 +0100)
Otherwise we'll get garbled data on Windows.

src/gallium/auxiliary/os/os_stream_stdc.c

index 37e7d063e2bf4c7f1e9d7d3204b262956a8e2aa0..afd3ff6dcea0738faffc5a5139d85f69ec825973 100644 (file)
@@ -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;