# HG changeset patch # User Michael Pavone # Date 1438066154 25200 # Node ID 7ed55a361e796fd06f311c0ce01a93eda28c1c18 # Parent 1f3ddeaacaee30a31ae52bbc4258f0245446b570 Use binary mode for reading shaders and config files so we actually get the number of bytes we expect diff -r 1f3ddeaacaee -r 7ed55a361e79 config.c --- a/config.c Mon Jul 27 23:42:54 2015 -0700 +++ b/config.c Mon Jul 27 23:49:14 2015 -0700 @@ -91,7 +91,7 @@ tern_node * parse_config_file(char * config_path) { tern_node * ret = NULL; - FILE * config_file = fopen(config_path, "r"); + FILE * config_file = fopen(config_path, "rb"); if (!config_file) { goto open_fail; } diff -r 1f3ddeaacaee -r 7ed55a361e79 render_sdl.c --- a/render_sdl.c Mon Jul 27 23:42:54 2015 -0700 +++ b/render_sdl.c Mon Jul 27 23:49:14 2015 -0700 @@ -117,13 +117,13 @@ { char * parts[] = {get_home_dir(), "/.config/blastem/shaders/", fname}; char * shader_path = alloc_concat_m(3, parts); - FILE * f = fopen(shader_path, "r"); + FILE * f = fopen(shader_path, "rb"); free(shader_path); if (!f) { parts[0] = get_exe_dir(); parts[1] = "/shaders/"; shader_path = alloc_concat_m(3, parts); - f = fopen(shader_path, "r"); + f = fopen(shader_path, "rb"); free(shader_path); if (!f) { warning("Failed to open shader file %s for reading\n", fname);