OSDN Git Service

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 37e7d06..afd3ff6 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;